简体   繁体   English

具有多组 SPS 和 PPS 且采用 avcc 编码的分段 MP4 视频

[英]Fragmented MP4 video with multiple sets of SPS and PPS with avcc encoding

I am trying to capture image of screen very frequently and then encode it in avcc format.我正在尝试非常频繁地捕获屏幕图像,然后以 avcc 格式对其进行编码。 Using the SPS, PPS, and avccnalunits of the encoded frames I am creating fragmented mp4 video and pushing those fragments to cloud, and concat all those fragments to form a big video mp4 file.使用编码帧的 SPS、PPS 和 avccnalunits,我正在创建分段的 mp4 视频并将这些片段推送到云端,并连接所有这些片段以形成一个大的视频 mp4 文件。 It works very well until and unless all the fragments have same SPS and PPS, but if there are multipe sets of SPS and PPS in single video its not playable.它工作得很好,除非所有片段都具有相同的 SPS 和 PPS,但如果单个视频中有多个 SPS 和 PPS 集,则它无法播放。 Please let me know which box should be modified to accommodate this.请让我知道应该修改哪个框以适应这个。

You have multiple options here and you should investigate them since the behaviours could differ between players:您在这里有多种选择,您应该调查它们,因为玩家之间的行为可能会有所不同:

  • Use multiple AVCConfigurationBox entries and then reference the proper sample description index via sample_description_index in the stsc box.使用多个AVCConfigurationBox条目,然后通过stsc框中的sample_description_index引用正确的示例描述索引。 I think this should be the most reliable, but then you need to update moov when new SPS/PPS arrive.我认为这应该是最可靠的,但是当新的 SPS/PPS 到达时您需要更新 moov。
  • There is a thing called parameter set stream (see 5.3.5 AVC parameter set stream definition of ISO 14496-15), each sample in that stream contains a new AVCConfigurationBox .有一个东西叫做参数集 stream(见 ISO 14496-15 的 5.3.5 AVC 参数集 stream 定义),每个样本在那个AVCConfigurationBox No idea how widely supported this is.不知道这得到了多么广泛的支持。

  • Always put the new SPS/PPS inline.始终将新的 SPS/PPS 内联。 Again, parsers may ignore the inline SPS/PPS and use the ones from the sample description box.同样,解析器可能会忽略内联 SPS/PPS 并使用示例描述框中的那些。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM