[libav-api] Packaging Raw H264/AAC frames into FLV/RTMP Stream

Luca Barbato lu_zero at gentoo.org
Mon Oct 3 18:58:26 CEST 2011

On 03/10/2011 15:16, Evgeny Yakimov wrote:
> Hello Lu
> I am using the same h264 raw frames (in this case from x264) both in my app
> and the ones that avconv reads from using the command:
> avconv -i /mnt/videos/raw.h264 -vcodec copy -f flv test.flv
> I have just created two flv files, one from my own code, and the other from
> the command above, which both use the same raw frames.
> I then wrote a quick program to read and dump the frames from the flv files
> so that I can compare them:
> http://pastebin.com/GAGNUT3S
> It seems that the first frame is much bigger, and every key frame is also at
> least 2 bytes bigger, every non key frame although the same size has been
> modified in byte 3 and 4. So it seems that avconv modifies these frames
> before writing them into the flv container.
> I have uploaded the entire program that I use to create my flv here (argv[1]
> points to a source file of raw 422 frames which are converted to 420 prior
> to being sent to x264)
> http://pastebin.com/wMGe554k
> (please ignore the audio for the time being)
> Any Idea on how avformat modifies these frames?


param.b_repeat_headers = 0;



Luca Barbato

More information about the libav-api mailing list