Sudheer Kumar
Sudheer Kumar

Reputation: 77

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. 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. 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. Please let me know which box should be modified to accommodate this.

Upvotes: 0

Views: 752

Answers (1)

Rudolfs Bundulis
Rudolfs Bundulis

Reputation: 11934

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. I think this should be the most reliable, but then you need to update moov when new SPS/PPS arrive.
  • 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. No idea how widely supported this is.

  • Always put the new SPS/PPS inline. Again, parsers may ignore the inline SPS/PPS and use the ones from the sample description box.

Upvotes: 2

Related Questions