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

Rich Felker dalias at aerifal.cx
Fri Aug 26 08:10:42 CEST 2005


On Fri, Aug 26, 2005 at 06:22:16AM +0100, ObsessiveMathsFreak wrote:
> 
> >I don't see any reason why it should. Taking screenshots is not a
> >normal function of watching a movie..
> >
> >
> >There is no way to give a "what you see is what you get" output. It
> >simply does not exist, since the scaled video only exists on the
> >phosphors of your crt (cells of your crappy tft) for a split second. 
> 
> There's an abundance of third party screenshot capture programs. People 
> 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.

No, they will not work at all. They'll give you a solid blue (or other
color) window, because THE PICTURE IS NOT THERE.

> Xine does this, but also gets in wrong in the same way as the 
> patch.

Huh? Before you were talking about third party screen capture
programs, now internal stuff again. Make up your mind..

> >They're not incorrectly sized but correct. They should just have
> >different horizontal and vertical dpi in the png header to indicate
> >the nonsquare samples (however I imagine vo_png is broken and does not
> >set these headers correctly).
> >
> I believe png can specify a pixel aspect ratio, for non square pixels, 
> if that's what you mean. However, png viewers aren't required to account 
> for this, and, though I haven't checked it, I doubt most do. vo_png 
> might actually be taking this into account, but do the viewers?

vo_png does not do it right. Viewers, I don't know.. but if they're
broken you should fix them. :)

> It would be nice to somehow rescale (terminology?) the image to some 
> required output before writing the png file. At the moment, I have 
> absolutly no idea how to go about this outside of putting some 
> additional filter or something in front of the screenshot filter. But 
> would that screw up the output?

It will just make playback incredibly slow.. Otherwise no problem.
Just use -vf scale,screenshot -zoom

> Is it possible in some way to grab the 
> pixels that were written to the screen, or have they been lost to the 
> program forever?

They were never written to the screen, that's the whole point. And yes
they are lost as far as MPlayer is concerned (they may still be in
buffers somewhere, but may not, and it depends entirely on the
specific vo driver used).

> I think I'll just re-encode my movies using a scale filter instead of 
> specifying an aspect ratio with matroska.

No, this is a VERY VERY STUPID THING TO DO. It significantly reduces
quality if you keep the bitrate the same, and slightly reduces quality
even if you increase the bitrate.

If you insist on taking screenshots, just scale at screenshot time.
BTW if you're going to use the screenshots on a website, just use the
width and height fields of the IMG tag to get the desired scaling...

> I imagine this is a pretty 
> esoteric issue anyway. But if matroska and the like get more popular, 
> maybe people will want to specify aspect ratios there instead? If indeed 
> there is anyone else out there crazy enough to give a danm!

There is no problem here; it's just that you're looking at the whole
aspect issue wrong.

Rich




More information about the MPlayer-dev-eng mailing list