1

该作业为视频和音频流设置 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"
         }
      ]
   },
}
4

1 回答 1

1

发生这种情况的原因是由于gopDuration==3s,segmentDuration==2s。gopDuration 必须 <= segmentDuration,同时,segmentDuration 必须能被 gopDuration 整除。

一旦你设置了 gopDuration==2s,你应该得到你想要的。

于 2021-08-23T18:21:17.067 回答