[Libav-user] Decoding specific formats?

Alex Cohn alexcohn at netvision.net.il
Thu Feb 23 22:28:50 CET 2012

On Thu, Feb 23, 2012 at 02:16, Patrick Zielinski <dzeesea at gmail.com> wrote:
> Ok, firstly please bare with me, up until two weeks ago I didn't even know
> what codec were and how encoding worked. Also, this code is ported within a
> C++ framework so it might not comply with your usual coding standards.
> Essentially here is the code that I have written which resembles closely to
> the libav decoding example with minor tweaks due to deprecated functions. I
> actually have a different version in our code, but it's mostly just working
> with the buffer and the image data to add to our own structure.
> http://pastebin.ca/2120920
> I'd like to have either tips on how I could make this more robust, or what
> steps I should take to extract each frame from different formats. I've taken
> a look at ffmpeg.c, but not as much as I wanted.

Regarding the specific problem decoding an MKV file, you did not write
if you succeed to open this particular file with command-line ffmpeg.

Regarding your code, you should use the AVCodecContext you get from
avformat_open_input() for the chosen stream, no need to create a new
one as you do in lines 127 and on.


More information about the Libav-user mailing list