Where's the output frame data in vd_ffmpeg.c's decode()?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Where's the output frame data in vd_ffmpeg.c's decode()?

boku
Hi all,
    I'd like to analyze the decoded data buffer after the decode
by avcodec_decode_video() in vd_ffmpeg.c.
Which data struct saves the output data? Is it the pic->data[] or
pic->base[]?
Thanks a lot!

BR,
boku
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Where's the output frame data in vd_ffmpeg.c's decode()?

Stefano Sabatini
On date Wednesday 2007-12-26 10:45:33 +0800, boku encoded:
> Hi all,
>     I'd like to analyze the decoded data buffer after the decode
> by avcodec_decode_video() in vd_ffmpeg.c.
> Which data struct saves the output data? Is it the pic->data[] or
> pic->base[]?

The decoded data is putted by avcodec_decode_video in picture, which
is an AVFrame, which contains as the first fields:
    uint8_t *data[4];\
    int linesize[4];\

so you can cast AVFrame to AVPicture, or directly access data and
linesize (but maybe I'm not understanding the question, maybe you're
referring to Mplayer specific structures).

The interpretation of data and linesize depends on the pixel format of
the picture, as well as on others information (such as width and
height) which you can access in the avcodec context.

> Thanks a lot!

HTH, regards.
--
ffmpeg-user random tip #12
One minute of pure video noise with ffmpeg:
ffmpeg -t 60 -s qcif -f rawvideo -pix_fmt rgb24 -r 25 -i /dev/urandom \
    -y noise.mpeg
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Where's the output frame data in vd_ffmpeg.c's decode()?

boku
On 12/27/07, Stefano Sabatini <[hidden email]> wrote:

> On date Wednesday 2007-12-26 10:45:33 +0800, boku encoded:
>
> The decoded data is putted by avcodec_decode_video in picture, which
> is an AVFrame, which contains as the first fields:
>    uint8_t *data[4];\
>    int linesize[4];\
>
> so you can cast AVFrame to AVPicture, or directly access data and
> linesize (but maybe I'm not understanding the question, maybe you're
> referring to Mplayer specific structures).
>
> The interpretation of data and linesize depends on the pixel format of
> the picture, as well as on others information (such as width and
> height) which you can access in the avcodec context.
>
Thanks, Stefano.
What if the output format is in UYVY422 packed and the frame size is
QCIF(352x288). Does it mean that:
All the UYVY frame output pixels will be stored only in *data[0]
with the linesize[0]=352*288?
Since it's packed data, i'm not sure how those data is stored within *data[4].
Thanks again for your help.

BR,
boku
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user