What if different colorspace for codec and display output?

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

What if different colorspace for codec and display output?

boku
Dear all,
    I have some questions about the video output and video filters (vf_vo.c).
1) Can a decoder decode input bit streams in different kinds of color
space format such as YUV420P, IYUV or UYVY422?
Or it only accepts one format such as YUV420? Also, where it can be defined?

2) Say if my specific mpeg decoder will decode YUV420P bit stream and
can only output one format of UYVY422 packed frame data,
how can I write my wrapper, vd_xxx.c in libmpcodecs to let video
output layer or the video filter change to the color space for the
output device?

3) For FFMPEG wrapper into mplayer, vd_ffmpeg.c, I checked out the
match mechanism in ::init() as folows:
            lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh->codec->dll);
it means mplayer uses "dll" field specified in codecs.conf to match
the decoder.
However, I checked the document and it seems "dll" field is not for
this definition or purpose. Am I misunderstanding?
Thank you!

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: What if different colorspace for codec and display output?

Stefano Sabatini
On date Friday 2007-12-28 15:02:34 +0800, boku encoded:
> Dear all,
>     I have some questions about the video output and video filters (vf_vo.c).
> 1) Can a decoder decode input bit streams in different kinds of color
> space format such as YUV420P, IYUV or UYVY422?
> Or it only accepts one format such as YUV420? Also, where it can be defined?

The input pixel formats supported are specified in every encoder, and
so for the output pixel format, that is you can't tell the decoder to
output video frames in a specific format.

AFAIK actually there isn't a method to expose programmatically the
supported pixel formats in input and in output, so you have to check
the code.

> 2) Say if my specific mpeg decoder will decode YUV420P bit stream and
> can only output one format of UYVY422 packed frame data,
> how can I write my wrapper, vd_xxx.c in libmpcodecs to let video
> output layer or the video filter change to the color space for the
> output device?

libswscale is supposed to address such conversions (that is
conversions from pixel format X to pixel format Y),
libavcodec/imgconvert.c also provides a deprecated API to do the same
thing.

(BTW: does libswscale stands for LIB SoftWare SCALE?)

> 3) For FFMPEG wrapper into mplayer, vd_ffmpeg.c, I checked out the
> match mechanism in ::init() as folows:
>    lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh->codec->dll);
> it means mplayer uses "dll" field specified in codecs.conf to match
> the decoder.
> However, I checked the document and it seems "dll" field is not for
> this definition or purpose. Am I misunderstanding?

Dunno.

> Thank you!

HTH, regards.
--
ffmpeg-user random tip #22
See the capture of a video4linux device:
ffplay -s 640x480 -f video4linux /dev/video0
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-user