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

David Cassany Viladomat david.cassany at i2cat.net
Mon Oct 20 09:35:40 CEST 2014

Thanks Carl, that's pretty useful.

I guess I was not clear enough when I asked I there was a way to do it in
FFMPEG, maybe I'd better say libavformat, I am not using the execution
binaries, I am writing my own application in C using libavformat,
libavcodec and so on. At the moment I am using FFMPEG examples "remuxing.c"
and "demuxing_decoding.c" as a reference to start coding my NALU extractor.
Then, according the Carl Eugen response I assume that I should use video
filters in order to do that, should I read about libavfilter to reproduce
"-vbsf h264_mp4toannexb" behaviour in my C application, or I have some kind
of solution to go throw it having some sort of remuxing in h264 format?

Thank all,

2014-10-18 1:21 GMT+02:00 Carl Eugen Hoyos <cehoyos at ag.or.at>:

> 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
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

More information about the ffmpeg-user mailing list