View Full Version : changing SPS (sequence parameter sets) for AVC video in MP4 files
Mosu
16th March 2007, 09:06
Hey,
I've tried searching but came up empty.
A user has sent me an AVC file in which the sequence parameter set changes in the middle of the stream. Meaning that for the same SPS ID there's new SPS content.
How is this supposed to be handled in MP4 files? The SPS are normally part of the avcc, but if they change in the middle, how is this supposed to be handled on the container level? My guess would be that they're simply left in the bitstream/frame and the avcc is not changed and the container does not take notice otherwise, but I don't know enough about MP4 to be sure.
mediator
16th March 2007, 09:16
At the container level you theoretically may have mutliple sample description entries for one (AVC-) video track, where each could carry different SPSs with same SPS id. The MP4 standard allows to switch between sample entries (via the "stsc" table, if I remember right) in the middle of a track. However, I doubt that any splitter out there supports this...
So, I think the only way to get this into an MP4 file would be to patch the SPS id (and thus the associated PPS ids as well).
In any case it seems not trivial...
bond
17th March 2007, 13:44
is it allowed in avc to have changing sps with the same id in general?
about the container issue you might find some infos here: http://www.itscj.ipsj.or.jp/sc29/open/29view/29n5245t.doc
Mosu
17th March 2007, 13:58
Foloowing the source of MP4Box I thought it was not allowed, because it only stores the SPS for each ID once and does not overwrite it. But I do have such a file, and I guess that more broken software is out there that could produce such files. Or "stupid" users by simply concatenating raw AVC streams. Etc etc.
orbitlee
17th March 2007, 15:06
I happened to know the *possible* source of such strange AVC files. Yes, "stupid" users concatenating raw AVC streams which are generated by different encoders. The purpose? Somtimes H.264 broadcast source have glitches. "stupid" users try to patch these glitches with good source(DVD, MPEG2 broadcast, etc) by encoding the good frames to relace bad frames. But they even don't know the meaning of SPS/PPS ID.
(So far I only found x264 support to specify different SPS/PPS ID, other h.264 encoders only output SPSID=0). But what surprised me is, both CoreAVC,Cyberlink h.264(maybe ffdshow) can handle such kind of AVC stream well.
bond
17th March 2007, 16:22
Foloowing the source of MP4Box I thought it was not allowed, because it only stores the SPS for each ID once and does not overwrite it. But I do have such a file, and I guess that more broken software is out there that could produce such files. Or "stupid" users by simply concatenating raw AVC streams. Etc etc.i dont know any avc encoder being able to create streams with changing sps. so i assume its the cat issue
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.