[MPlayer-users] Intelligent dynamic scaling.
Baxter Kylie
baxter.kylie at gmail.com
Thu Jun 28 08:16:40 CEST 2007
Hi. As sort-of a 'thank you' to those who have helped me on the list I
thought I'd share the fruits of my labor, so to speak...
It's a wrapper for mplayer designed for use-scenarios where use of the
command line or gui isn't practical (in my case a mythbox). The
solution it provides is intelligent dynamic fullscreen scaling that
adapts itself to the aspect ratio of the content so that it does not
scale to a resolution > than your display's (and thus default to a
poor quality display native scale)
Caveats:
1) This is not meant for command-line kings who love to throw options
all around. I am assuming you have pre-determined use scenarios and
that those scenarios are captured in the form of config profiles. It
passes profiles :) and since profiles stack this should serve most
purposes.
2) Some profiles may desire not to implement scaling. Those are
capable of being specified but you need to do so in the bash script
itself (a variable array at the top is there)
3) I took the liberty of defining that, with content > display
resolutions it should be assumed that this is not something that needs
any filtering whatsoever and a vf-clr argument is passed instead.
4) There's no error handling other than an exit, I took the easy way
with getopts so options must be given first (before the filename), and
I couldn't figure out (aka was too tired to mess with) how to pass
mplayer's stdout back up to the wrapper's stdout. What does this mean?
I'm not a bash guru, genius, acolyte, or even apprentice. I'm just a
guy who had a need and taught himself enough to get by. For example,
I'd love to use the DISPLAY variable and xdpyinfo to grab the screen
resolution but my xdpyinfo isn't interested in working properly
(always displays max possible res -- I blame nvidia binary) so I
didn't bother finishing it.
But the good news is that this is an open sourced world. Feel free to
take this and run with it or use it. It's just a wrapper and I'm not
going to be doing much in the way of 'support' but, again, I thought I
should give back a little.
So, without further ado... you'll find it attached.
Best and thanks to all.
~BK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpwrapper.sh
Type: application/x-sh
Size: 3892 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20070628/a5c0a684/attachment.sh>
More information about the MPlayer-users
mailing list