[FFmpeg-user] Get H264 NALUs from a muxed file

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Oct 18 01:21:33 CEST 2014


David Cassany Viladomat <david.cassany <at> i2cat.net> writes:

> in MPEG2-TS I get the data with the start_code (0001) to 
> divide the NALUs, but with the MP4 I get the frame without 
> start codes but 4 bytes indicating NALU size instead. I 
> now this is due each container specification, but I am 
> wondering if there is a way with FFMPEG to get exactly the 
> same data regardless the container.

Yes, the following should produce similar result:

$ ffmpeg -i in.ts -vcodec copy -an -f image2 out%4d
$ ffmpeg -i in.mp4 -vcodec copy -vbsf h264_mp4toannexb -an -f image2 out%4d

Carl Eugen



More information about the ffmpeg-user mailing list