[MPlayer-dev-eng] [patch][rfc] screenshot. Aspect Ratio problems

Jan Knutar jknutar at nic.fi
Fri Aug 26 12:49:40 CEST 2005


On Friday 26 August 2005 08:22, ObsessiveMathsFreak wrote:

> really like taking screenshots. A lot of distros now include some kind 
> of screen capture function as well, which is more or less a poor mans 
> WYSIWYG.

To clarify in case it was lost in all the yelling... 

With the most advanced video out options available, such as mga_vid and
Xvideo, you give the graphics board the pixels in YV12 colourspace (which
is not the RGB that PNG files need), in the original, unscaled size.

The graphics board  then replaces a part of the screen with the video, scaled
apropriately and converted to the RGB signal the monitor wants.

There is no way for the computer to retrieve the image on the monitor, there exists
no electrical pathways on the graphics board to route back the signal, and there
exists no ADC on the graphics board to digitize the signal.

I'm not sure it's even possible to read back the unscaled YV12 image you
give the graphics board :)

So unless there's some filter sitting in between the decoder and the video output,
once a frame is decoded and pushed the the graphics board, it's "lost". As png
requires RGB, you have first scale filter converting from YV12 to RGB, screenshot
filter, then scale to do RGB->YV12 again. What a CPU waste, and you don't even
get WYSIWYG despite throwing all that CPU at it! :)

Now a cool thing, which would also open up the doors for many other neat features
at the same time, would be if MPlayer could reconfigure the vf filter pipeline in
realtime, to insert scale,screenshot,scale only when needed.
Even crazier, to have the frame-exact seek ability, so that one could do away with
the one-frame latency for taking screenshots too :-) But then it'd probably end up
being as slow as xine :(

Those two combined would require some major surgery to mplayer.c's main, the
only person crazy enough to touch main(){} is Oded but we've so far been unsuccessful
in forcing him to do it :)
Maybe surgery is the wrong word, rewrite perhaps... It's all probably in the TODO/WISHLIST
too...




More information about the MPlayer-dev-eng mailing list