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. On Wed, Feb 22, 2012 at 11:22 AM, Alex Cohn <[email protected]>wrote: > On Tue, Feb 21, 2012 at 23:24, Patrick Zielinski <[email protected]> > wrote: > > Hello all, I have integrated decoding with libavformat and libavcodec a > > basic decoder. It works for H264 encoded video's and also I converted one > > into avi, it also works. > > > > But for some reason when I try other formats like .mkv I receive this > > error: > > > > [h264 @ 05f32a80] no frame! > > > > I've encoded the mkv's with x264 so I'm having a hard time understand > how > > it cannot find a frame, it occurs when I call > > > > avcodec_decode_video2(pCodecCtx, pFrame, &gotFrame, &packet); > > > > > > What kind of details am I missing, because the different structs seem to > > have correct data. > > You probably have metadata missing, e.g. SPS/PPS, if MKV container > keeps this information not with the frames that you push into > avcodec_decode_video2(). Please make sure that your mkv can be played > by command-line ffmpeg. If this simple test succeeds, please make your > initialization code available (e.g. via pastebin). > > BR, > Alex > _______________________________________________ > Libav-user mailing list > [email protected] > http://ffmpeg.org/mailman/listinfo/libav-user > >
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
