[Libav-user] Creating mp4 (h264 codec) video from OpenGL frames

"Matthias Bühlmann" genesys at gmx.ch
Sat May 12 20:46:19 CEST 2012

check the libavformat/output-example.c (instead of the libavcodec/api-example.c)

following the same steps as in this file (but for mp4 instead of mpeg) i was able to write an opengl output directly into an mp4 that i could play with quicktime.

what I didn't manage was to encode packages that i could use as stream as well as writing them to mp4 file at once (since the mp4 file seems to require a global header while a stream requires the header to be in the packages or something like that and the way x264 lib is used by ffmpeg only one or the other seems to be possible). But that's most likely not what you need so the libavformat/output-example.c should give you what you need.

-------- Original-Nachricht --------
> Datum: Thu, 10 May 2012 18:19:05 +0300
> Von: Alex Cohn <alexcohn at netvision.net.il>
> An: "This list is about using libavcodec, libavformat, libavutil, 	libavdevice and libavfilter." <libav-user at ffmpeg.org>
> Betreff: Re: [Libav-user] Creating mp4 (h264 codec) video from OpenGL frames

> On Thu, May 10, 2012 at 5:16 PM, Alex Druml <alex3.dr at googlemail.com>
> wrote:
> >
> > hello!
> >
> > i am currently trying to encode frames (RGB) rendered with opengl into a
> mp4
> > file encoded with h264.
> >
> > i already managed to convert the frames from RGB to YUV (swscale) and i
> > use the video_encode_example example from
> >
> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cb63294b142f007cf78436c5d81c08a49f3124be;hb=HEAD
> >
> > to encode the frames into a h264 file (vlc already plays the file). now
> > i want to write this encoded file into a common container like mp4.
> >
> > i found a muxing example here
> >
> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=9d338dee670699d07b1f87505d78ee52a17cb920;hb=HEAD
> >
> > but is it possible to write the encoded frames directly into a mp4 file?
> >
> > best regards!
> No, you must conform to mp4 container logic. This is what the muxer is
> for.
> BR,
> Alex Cohn
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a

More information about the Libav-user mailing list