[MPlayer-users] Greyscale "tricks"

Matthew W. Miller mwmiller at columbus.rr.com
Thu Jul 15 04:58:36 CEST 2004


On Wed, Jul 14, 2004 at 08:24:58PM +0200, Meino Christian Cramer wrote:
> I have a video stream witch is black and white (grayscaled).
>
> "From the physical point of view" one would only need one "color"
> instead of three to encode the video stream in greyscale but as I
> understood the documentation all available colorspaces are "three
> dimensional" (but may be I am wrong).

Pretty much any MPEG4-based encoded video uses a luma channel which
describes lightness/darkness, and one or more chroma channels which
describe colouration.  The most common by far is YCbCr (sometimes called
YUV); the Y channel is luma, Cb (Chroma blue) describes yellow<->blue,
Cr (Chroma red) describes cyan<->red.  Greenness depends on all three. 
See DOCS/tech/colorspaces.txt for further detail on this.

So I guess what you want to know is how to devote more bits to the Y
channel, which is the only one that's really important for grayscale
video, and fewer to the unimportant colour channels.  libavcodec
*should* do that automatically, really, as part of the encoding.

If you're getting too much colour noise, you could use mencoder with one
of the blurring video filters (see mplayer manual page under section
"VIDEO FILTERS"), and specify that it should affect only the chroma
channels, not luma.  unsharp can be made to do this, for example
('unsharp=c11x11:-1.0'), and so can denoise3d/hqdn3d
('denoise3d=0:254:0' or 'hqdn3d=0:254:0').

And of course, there's always the lavc encoding option 'grayscale' which 
throws away the chroma channels entirely. =)
-- 
Matthew W. Miller <mwmiller at columbus.rr.com>      MPlayer does not suck.




More information about the MPlayer-users mailing list