[FFmpeg-devel] YUV image conversion

Ronald S. Bultje rsbultje
Fri Mar 4 04:57:17 CET 2011


Hi,

On Thu, Mar 3, 2011 at 7:52 PM,  <jelliott at rohan.sdsu.edu> wrote:
> My problem is that when the U and V components are zero'd out, I obtain a
> green image when I am expecting a black and white image. ?On the other end
> of the spectrum, when I set the U and V components to 255, I obtain a dark
> magenta image. ?A black and white image can only be obtained if the U and
> V components are set to their midrange values of 217. ?I have attached
> copies of sample images to illustrate this.
>
> I have found out, through emailing one of the authors of ffmpeg, that the
> U and V components have an offset of 128 in order to represent negative
> values. ?I need to find out where in ffmpeg this offset is taking place.
> I only want to stream the Y data without having to transmit values for the
> U and V data. ?I want to be able to set those values to 0 initially and
> only transmit the Y data. ?If someone could point me in the right
> direction as to how to do this or just point me to where the UV offset is
> coded, I would greatly appreciate it.

Your solution is likely to transmit Y-data only and read it as
PIX_FMT_GRAY (which is basically Y-only, like Y800) to
PIX_FMT_YUV420P, that will do approximately the right thing.

Ronald



More information about the ffmpeg-devel mailing list