This job sets 2s segments for the video and audio streams. The video total duration is 134s, so I would expect about 67 segments. However we see in the MPD manifest that there are 45 video segments, and 54 audio segments (for each audio track).
Is this the expected behavior? Our player does buffer more than 2s at once.
Why is there a different number of video and audio segments?
Job Config
{
"config":{
"inputs":[
{
"key":"input0",
"uri":"gs://inputfile.mp4"
}
],
"editList":[
{
"key":"atom0",
"inputs":[
"input0"
],
"endTimeOffset":"134.549s",
"startTimeOffset":"0s"
}
],
"elementaryStreams":[
{
"videoStream":{
"codec":"h264",
"profile":"high",
"preset":"veryfast",
"widthPixels":224,
"pixelFormat":"yuv420p",
"bitrateBps":500000,
"rateControlMode":"crf",
"crfLevel":24,
"vbvSizeBits":500000,
"vbvFullnessBits":450000,
"gopDuration":"3s",
"entropyCoder":"cabac",
"frameRate":0.1
},
"key":"thumbnail-lowfps-stream"
},
{
"videoStream":{
"codec":"h264",
"profile":"high",
"preset":"veryfast",
"widthPixels":224,
"pixelFormat":"yuv420p",
"bitrateBps":500000,
"rateControlMode":"crf",
"crfLevel":24,
"vbvSizeBits":500000,
"vbvFullnessBits":450000,
"gopDuration":"3s",
"entropyCoder":"cabac",
"frameRate":1
},
"key":"thumbnail-mediumfps-stream"
},
{
"videoStream":{
"codec":"h264",
"profile":"high",
"preset":"veryfast",
"widthPixels":224,
"pixelFormat":"yuv420p",
"bitrateBps":500000,
"rateControlMode":"crf",
"crfLevel":24,
"vbvSizeBits":500000,
"vbvFullnessBits":450000,
"gopDuration":"3s",
"entropyCoder":"cabac",
"frameRate":5
},
"key":"thumbnail-highfps-stream"
},
{
"videoStream":{
"codec":"h264",
"profile":"high",
"preset":"veryfast",
"widthPixels":224,
"pixelFormat":"yuv420p",
"bitrateBps":500000,
"rateControlMode":"crf",
"crfLevel":24,
"vbvSizeBits":500000,
"vbvFullnessBits":450000,
"gopDuration":"3s",
"entropyCoder":"cabac",
"frameRate":2.23
},
"key":"thumbnail-dynamicfps-stream"
},
{
"videoStream":{
"codec":"h264",
"profile":"high",
"preset":"veryfast",
"widthPixels":400,
"pixelFormat":"yuv420p",
"bitrateBps":500000,
"rateControlMode":"crf",
"crfLevel":24,
"vbvSizeBits":500000,
"vbvFullnessBits":450000,
"gopDuration":"3s",
"entropyCoder":"cabac",
"frameRate":8.919
},
"key":"preview-ld-stream"
},
{
"videoStream":{
"codec":"h264",
"profile":"high",
"preset":"veryfast",
"widthPixels":852,
"pixelFormat":"yuv420p",
"bitrateBps":500000,
"rateControlMode":"crf",
"crfLevel":24,
"vbvSizeBits":500000,
"vbvFullnessBits":450000,
"gopDuration":"3s",
"entropyCoder":"cabac",
"frameRate":30
},
"key":"preview-hd-stream"
},
{
"audioStream":{
"codec":"aac",
"bitrateBps":128000,
"channelCount":2,
"channelLayout":[
"fl",
"fr"
],
"mapping":[
{
"key":"atom0",
"channels":[
{
"inputs":[
{
"key":"input0",
"track":1
}
]
},
{
"inputs":[
{
"key":"input0",
"track":1,
"channel":1
}
]
}
]
}
],
"sampleRateHertz":48000
},
"key":"audio-stream-1"
},
{
"audioStream":{
"codec":"aac",
"bitrateBps":128000,
"channelCount":2,
"channelLayout":[
"fl",
"fr"
],
"mapping":[
{
"key":"atom0",
"channels":[
{
"inputs":[
{
"key":"input0",
"track":2
}
]
},
{
"inputs":[
{
"key":"input0",
"track":2,
"channel":1
}
]
}
]
}
],
"sampleRateHertz":48000
},
"key":"audio-stream-2"
},
{
"audioStream":{
"codec":"aac",
"bitrateBps":128000,
"channelCount":2,
"channelLayout":[
"fl",
"fr"
],
"mapping":[
{
"key":"atom0",
"channels":[
{
"inputs":[
{
"key":"input0",
"track":3
}
]
},
{
"inputs":[
{
"key":"input0",
"track":3,
"channel":1
}
]
}
]
}
],
"sampleRateHertz":48000
},
"key":"audio-stream-3"
},
{
"audioStream":{
"codec":"aac",
"bitrateBps":128000,
"channelCount":2,
"channelLayout":[
"fl",
"fr"
],
"mapping":[
{
"key":"atom0",
"channels":[
{
"inputs":[
{
"key":"input0",
"track":4
}
]
},
{
"inputs":[
{
"key":"input0",
"track":4,
"channel":1
}
]
}
]
}
],
"sampleRateHertz":48000
},
"key":"audio-stream-4"
}
],
"muxStreams":[
{
"key":"thumbnail-lowfps-mux",
"fileName":"small_low_fps.mp4",
"container":"mp4",
"elementaryStreams":[
"thumbnail-lowfps-stream"
]
},
{
"key":"thumbnail-mediumfps-mux",
"fileName":"small_mid_fps.mp4",
"container":"mp4",
"elementaryStreams":[
"thumbnail-mediumfps-stream"
]
},
{
"key":"thumbnail-highfps-mux",
"fileName":"small_high_fps.mp4",
"container":"mp4",
"elementaryStreams":[
"thumbnail-highfps-stream"
]
},
{
"key":"thumbnail-dynamicfps-mux",
"fileName":"small_dynamic_fps.mp4",
"container":"mp4",
"elementaryStreams":[
"thumbnail-dynamicfps-stream"
]
},
{
"key":"preview-ld-mux",
"fileName":"preview_seek.mp4",
"container":"mp4",
"elementaryStreams":[
"preview-ld-stream"
]
},
{
"key":"preview-hd-mux-dash",
"fileName":"preview-hd-mux-dash.m4s",
"container":"fmp4",
"elementaryStreams":[
"preview-hd-stream"
],
"segmentSettings":{
"segmentDuration":"2s"
}
},
{
"key":"audio-stream-1-mux",
"fileName":"audio-stream-1-mux.m4s",
"container":"fmp4",
"elementaryStreams":[
"audio-stream-1"
],
"segmentSettings":{
"segmentDuration":"2s"
}
},
{
"key":"audio-stream-2-mux",
"fileName":"audio-stream-2-mux.m4s",
"container":"fmp4",
"elementaryStreams":[
"audio-stream-2"
],
"segmentSettings":{
"segmentDuration":"2s"
}
},
{
"key":"audio-stream-3-mux",
"fileName":"audio-stream-3-mux.m4s",
"container":"fmp4",
"elementaryStreams":[
"audio-stream-3"
],
"segmentSettings":{
"segmentDuration":"2s"
}
},
{
"key":"audio-stream-4-mux",
"fileName":"audio-stream-4-mux.m4s",
"container":"fmp4",
"elementaryStreams":[
"audio-stream-4"
],
"segmentSettings":{
"segmentDuration":"2s"
}
}
],
"manifests":[
{
"fileName":"preview_main.mpd",
"type":"DASH",
"muxStreams":[
"preview-hd-mux-dash",
"audio-stream-1-mux",
"audio-stream-2-mux",
"audio-stream-3-mux",
"audio-stream-4-mux"
]
}
],
"output":{
"uri":"gs://output-bucket"
},
"spriteSheets":[
{
"format":"jpeg",
"filePrefix":"small_mid_fps_sprite-",
"spriteWidthPixels":224,
"spriteHeightPixels":126,
"columnCount":1,
"rowCount":1,
"startTimeOffset":"0s",
"interval":"1s"
}
]
},
}
The reason this happen is due to gopDuration==3s, and segmentDuration==2s. gopDuration has to be <= segmentDuration, and, at the same time, segmentDuration has to be divisible by gopDuration.
Once you set gopDuration==2s, you should get what you want.