[FFmpeg-devel] h264-parser splits before PPS thus muxing to mp4 fails

Thorsten Jordan tjordan
Wed Jan 30 14:10:30 CET 2008

Thorsten Jordan schrieb:
> Thorsten Jordan schrieb:
>> Hello,
>> i encountered a problem while remuxing h264 material from TS to MP4.
>> Video stream is copied, Audiostream transformed from AC3 to AAC, but
>> only video matters here.
>> The problem is that the input reader uses h264_parser to split the data,
>> which exits just after SPS is found (h264_parser.c line 129 ff) but the
>> MP4 muxer wants SPS and PPS, thus the assertion in mov_write_avcc_tag
>> fails (movenc.c line 478).
> Maybe it should be extended by ignoring SEI here as well?

and one more problem with the splitter vs. the movenc. If the h264
elementary stream starts with some rest before the 00 00 00 01 x9 of the
AUD (can happen when source is from TS), then this leads to a failed
condition in movenc.c (line 486) and thus that data is just written to
the mp4 without any checks leading to a corrupt file.

If i ensure that the extradata starts with 00 00 00 01 before giving
that to the movenc, it works fine, the resulting mp4 is ok. I don't know
however if that check should be part of the splitter as well or must be
performed independently of the splitter.

Regards, Thorsten

More information about the ffmpeg-devel mailing list