google-cloud-transcoder - 输出 DASH 段比谷歌云转码器请求的长
问题描述
该作业为视频和音频流设置 2s 段。视频总时长为 134 秒,所以我预计大约 67 段。然而,我们在 MPD 清单中看到有 45 个视频片段和 54 个音频片段(对于每个音轨)。
这是预期的行为吗?我们的播放器一次缓冲超过 2 秒。
为什么有不同数量的视频和音频片段?
作业配置
{
"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"
}
]
},
}
解决方案
发生这种情况的原因是由于gopDuration==3s,segmentDuration==2s。gopDuration 必须 <= segmentDuration,同时,segmentDuration 必须能被 gopDuration 整除。
一旦你设置了 gopDuration==2s,你应该得到你想要的。
推荐阅读
- ios - 如何在不禁用列表项命中测试的情况下启用对列表项的选择?
- javascript - 显示模块未找到错误即“无法解析模块@react-native-community/async-storage”,即使已安装模块
- c++ - 使用循环 C++ 遍历向量
- php - 如何通过 Bootstrap 将分页输出到 php?
- google-apps-script - Google App Script Card Service datepicker 返回奇怪的值
- gitlab - gitlab-ci 注册运行器 x509
- liferay - Liferay 7 Web 内容显示 - 全球站点中的 Web 内容不可用
- cakephp-3.0 - Cakephp 3:如何通过其包含的模型限制查询
- javascript - PDFJS:在画布上渲染 PDF
- sql - 计算一个表的出现次数并插入另一个表但出现错误