I’m working with video transcoding using the Google Cloud Transcoder API.
Considering that my partial job configuration is this:
{
"elementaryStreams": [
{
"key": "video-stream1",
"videoStream": {
"h264": {
"heightPixels": 144,
"widthPixels": 256,
"bitrateBps": 216000,
"frameRate": 25,
"pixelFormat": "yuv420p",
"rateControlMode": "vbr",
"bFrameCount": 3,
"profile": "main",
"enableTwoPass": true,
"preset": "slow"
}
}
},
{
"key": "video-stream2",
"videoStream": {
"h264": {
"heightPixels": 240,
"widthPixels": 428,
"bitrateBps": 360000,
"frameRate": 25,
"pixelFormat": "yuv420p",
"rateControlMode": "crf",
"crfLevel": 10,
"bFrameCount": 3,
"aqStrength": 1,
"profile": "main",
"tune": "film",
"preset": "medium"
}
}
},
{
"key": "audio-stream0",
"audioStream": {
"codec": "aac",
"bitrateBps": 96000
}
}
],
"muxStreams": [
{
"key": "144p-ts",
"container": "ts",
"elementaryStreams": [
"video-stream1",
"audio-stream0"
],
"segmentSettings": {
"individualSegments": true
}
},
{
"key": "240p-ts",
"container": "ts",
"elementaryStreams": [
"video-stream2",
"audio-stream0"
],
"segmentSettings": {
"individualSegments": true
}
}
],
"manifests": [
{
"fileName": "manifest.m3u8",
"type": "HLS",
"muxStreams": [
"144p-ts",
"240p-ts"
]
}
]
}
Note: The input and output fields are defined dynamically in my Node.js code.
This way, the video segments are stored in the bucket as shown in the image below:
bucket output folder image
I would like to group the segment files into a specific folder associated with the video resolution.
The expected result would be this:
- 144p/ (folder where the 144p resolution segments should be)
- 244p/ (folder where the 240p resolution segments should be)
- 144p-ts.m3u8
- 240p-ts.m3u8
- manifest.m3u8
I didn’t find anything in the documentation that allows me to do this.
Miqueas Amorim is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.