Hi Mark,

On Fri, Jan 23, 2009 at 10:20 AM, Mark Kenna
<[email protected]> wrote:
>> HTH,
>> Ronald
>> _______________________________________________
>> libav-user mailing list
>> [email protected]
>> https://lists.mplayerhq.hu/mailman/listinfo/libav-use

Again, please cut this footer when replying.

> The way I am currently working is to create a AVCodecContext

Wait, your question is about AV_Codec_Context or AV_Format_Context? My
answer is for AV_Format_Context, not _Codec_Context.

> populate
> the required fields, then keep calling "avcodec_decode_video" with an
> array of bytes representing one complete frame, then immediately
> refreshing a PictureBox with the decoded image.
> The problem is that the frames are decoded in the order that they are
> given, and sometimes when decoding, they appear out of order and require
> sorting according to PTS.
>
> I would like to avoid having to write my own protocol to fix this. What
> I would like is to have a way of decoding frames as above, and have the
> frames decoded in the correct order. Is that possible?

Of course, if your frames are out of order, it suggests your
AVCodecContext is not properly set up. has_b_frames could be set
wrongly, the input frame timestamps could be wrong (AVFrame.*), etc.
Since you're using your own home-brew solution for getting to this
step, you'll probably want to do your own home-brew debugging until
you figure out what you're doing (inputting) differently compared to
ffplay.c/ffmpeg.c. av_decode_video() should do frame reordering for
you and should output frames with increasing PTS.

Ronald
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to