Implementing GCP transcoder API, Some of the details are unclear for the implementation below queries
config {
inputs {
key: "input0"
uri: "gs://demo-input/e9f33d5"
}
edit_list {
key: "atom0"
inputs: "input0"
start_time_offset {
}
}
elementary_streams {
video_stream {
h264 {
width_pixels: 640
height_pixels: 360
frame_rate: 60.0
bitrate_bps: 550000
pixel_format: "yuv420p"
rate_control_mode: "vbr"
crf_level: 21
gop_duration {
seconds: 3
}
vbv_size_bits: 550000
vbv_fullness_bits: 495000
entropy_coder: "cabac"
profile: "high"
preset: "veryfast"
}
}
key: "video_stream0"
}
elementary_streams {
audio_stream {
codec: "aac"
bitrate_bps: 64000
channel_count: 2
channel_layout: "fl"
channel_layout: "fr"
sample_rate_hertz: 48000
}
key: "audio_stream0"
}
mux_streams {
key: "ts_aes128"
file_name: "ts_aes128.ts"
container: "ts"
elementary_streams: "video_stream0"
elementary_streams: "audio_stream0"
segment_settings {
segment_duration {
seconds: 3
}
individual_segments: true
}
encryption_id: "aes-128"
}
output {
uri: "gs://deletion-test1/c952bf80-7f82/"
}
encryptions {
aes_128 {
}
id: "aes-128"
secret_manager_key_source {
secret_version: "projects/7558/secrets/dev-demo-secretkey/versions/1"
}
drm_systems {
clearkey {
}
}
}
}
error {
code: 3
message: "Secret config field config.encryptions[0].secretManagerKeySource.secretVersion is an invalid json, expected a valid json."
details {
type_url: "type.googleapis.com/google.rpc.BadRequest"
value: "\nJ\n:config.encryptions[0].secretManagerKeySource.secretVersion\022\fInvalid JSON"
}
}
audio-only0000000000.m4s
hd.mp4
manifest.m3u8
manifest.mpd
media-hd.m3u8
media-hd0000000000.ts
media-sd.m3u8
media-sd0000000000.ts
sd.mp4
video-only-hd0000000000.m4s
video-only-sd0000000000.m4s
Thanks for support
Solved! Go to Solution.
1. The error you're encountering seems to be related to the JSON format for specifying the secret version. Make sure your JSON format is correct. You might want to check the JSON structure and ensure that it adheres to the required format. Refer to the SecretManagerKeySource documentation for details on how to structure the JSON.
2. For a multi-tenant approach, you generally need to manage keys separately for each tenant. Each video should have its own set of encryption keys. This ensures that the content for one tenant is not accessible by another. When using the Transcoder API, you would generate and manage these keys securely.
3. To protect the video player and access to configuration, you should implement proper authentication and authorization mechanisms. This might involve securing the configuration files, using authentication tokens, and ensuring that only authorized users or applications can access the player and related resources.
4. If you don't want to make your bucket public, you can use more fine-grained access controls. Grant the necessary permissions only to the entities that need them, such as the service account used by your video player. You don't necessarily need to make everything publicly readable.
5. The Transcoder API typically generates HLS or DASH manifests (like manifest.m3u8 or manifest.mpd). These manifest files reference the segmented media files (.ts files). You can control access to these files through proper bucket permissions. The player should be configured to use the manifest file, and it will internally handle the access to the individual media segments.
6. Best practices for transcoding API Implementation:
7. To use signed URLs, you can generate a signed URL for each resource (e.g., video file) and provide that URL to the client. The signed URL includes a signature based on your private key, allowing controlled access to the specified resource for a limited time.
1. The error you're encountering seems to be related to the JSON format for specifying the secret version. Make sure your JSON format is correct. You might want to check the JSON structure and ensure that it adheres to the required format. Refer to the SecretManagerKeySource documentation for details on how to structure the JSON.
2. For a multi-tenant approach, you generally need to manage keys separately for each tenant. Each video should have its own set of encryption keys. This ensures that the content for one tenant is not accessible by another. When using the Transcoder API, you would generate and manage these keys securely.
3. To protect the video player and access to configuration, you should implement proper authentication and authorization mechanisms. This might involve securing the configuration files, using authentication tokens, and ensuring that only authorized users or applications can access the player and related resources.
4. If you don't want to make your bucket public, you can use more fine-grained access controls. Grant the necessary permissions only to the entities that need them, such as the service account used by your video player. You don't necessarily need to make everything publicly readable.
5. The Transcoder API typically generates HLS or DASH manifests (like manifest.m3u8 or manifest.mpd). These manifest files reference the segmented media files (.ts files). You can control access to these files through proper bucket permissions. The player should be configured to use the manifest file, and it will internally handle the access to the individual media segments.
6. Best practices for transcoding API Implementation:
7. To use signed URLs, you can generate a signed URL for each resource (e.g., video file) and provide that URL to the client. The signed URL includes a signature based on your private key, allowing controlled access to the specified resource for a limited time.