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