[Libav-user] Encoding with H264 help/advice needed...

Philip Schneider pjschneider at earthlink.net
Tue Jan 27 17:13:35 CET 2015

Greetings -

Video n00b here…

I’ve been using FFmpeg to encode a sequence of raw RGB frames to a movie file, in a C/C++ app. I basically took the code from here:

    http://ffmpeg.org/doxygen/trunk/doc_2examples_2decoding__encoding_8c-example.html <http://ffmpeg.org/doxygen/trunk/doc_2examples_2decoding__encoding_8c-example.html>

The video_encode_example() function synthesizes each frame’s data; in my case I have a data pointer, width, height, and rowbytes, so I just use sws_scale() to convert to YUV and I’m good to go. So far I’ve been using AV_CODEC_ID_MPEG2VIDEO. Plays on every movie player I have on my Mac (VLC, QuickTime Player, etc, etc)

For obvious (?) reasons I want H.264. Swapping in that codec (using x264 or openh264) gives me a movie. I can play this on a Mac with VLC, but QuickTimePlayer doesn’t like the format (tries to “convert” and says “QuickTime Player can’t open <filename>”.

The “file” command gives me back this:

    JVT NAL sequence, H.264 video @ L 13

It does not surprise me much that simply dropping in a different codec yields a movie that can’t be opened by some particular player, given all the possible format and codec properties/settings.

But, it seems that I should be able to configure the necessary codec and/or container properties such that I get a movie file that can be opened with a wider variety of apps (particularly QuickTime Player, given it’s supposed to support a variety of formats and codecs)

I’m guessing I’m just missing a few settings, but I really don’t know where to start looking. Any help/advice/pointers/documentation would be greatly appreciated…

- Philip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20150127/ae70f4c7/attachment.html>

More information about the Libav-user mailing list