trouble with the -vm option
Hi, this is a rather longish report, please be patient with me (: I use MPlayer cvs version of today on an Athlon-850 box running Debian/GNU Linux unstable (of today). I can provide further system details if needed. I am using MPlayer to display movies on my tv. For this, I have an additional pci graphics card in my box that is connected to the rgb "scart" input of the tv using a simple circuit. Both the pci and the main agp card are driven using the multi-head capabilities of XFree86 4.1.0; the screens are set up as :0.0 (my monitor connected to the agp card) and :0.1 (the tv). The tv screen offers square pixel resolutions (768x576@50Hz(i) and 640x480@60Hz(i)) as well as dvd-resolutions (720x576@50Hz(i) and 720x480@60Hz(i)) In the XF86Config-4 file I omitted the "Rightof" or "LeftOf" options in the layout section, so the mouse cannot be moved from the main (:0.0) to the second (:0.1) screen. It drives me crazy when the mouse cursor gets lost because I hit the edge of the screen. I wanted to use the -vm option to make MPlayer use an appropriate resolution depending on the viewed material, and the -display option to select the display. As the pci card is a Matrox Mystique (no XVideo) I use the x11 video output together with the -fs -zoom -sws 2 options to get fullscreen. The movies are displayed correctly , but if I use the -vm option, MPlayer "steals" the mouse cursor and places it on the tv screen. When MPlayer stops playback, the mouse cursor is placed back on the main screen. So I cannot use the main screen while MPlayer is running. If I use the "RightOf" option in the XF86Config I can move the mouse back to the main screen, but this invariably messes with the tv display, if a resolution smaller than 768x576 is chosen by the -vm option. (the desktop has a virtual size of 768x576 and moving the mouse leads to moving the visible part of the desktop as soon as you hit the borders). If I do not use the -vm option, the mouse cursor stays on the main screen, and I can use the main screen while MPlayer is running. So I think the "stolen" mouse cursor is not an intended behaviour. I tried to read through the source to find out why there was a difference in behaviour, but my C and X programming skills seem to be lacking. Reading through x11_common.c and vo_x11.c I found the #ifdef'ed parts containing the mode switch logic, but no hint that the mouse cursor was touched at all ): My only guess would be that one of the XF86* library function calls does something to the mouse cursor, but the respective man pages gave me no nore clues ): The question is: Can the -vm option be changed so that it does not place the mouse cursor on the screen where the movie is displayed? Thanks for a great piece of software and your support, Magnus BTW: If you are interested in the circuit used to connect the tv and the pci card, you can have a look at my home page: http://www.unix-ag.uni-kl.de/~pfeffer/tvout/ where I documented it (sorry, its in German) or the web page that I used for information on the circuit: http://www.sput.nl/hardware/tv-x.html (English, but very terse and slighly wrong modelines)
hi. i've tested your little circuit and have to say it works really well. and i've encountered the problem you described. i found two ways around it: the first is a patch to mplayer, that adds a -grabmouse option (grabmouse=0 in the config file) so mplayer doesn't grab the cursor anymore. and (by pure chance) it doesn't unpause when any key is pressed. the second is a little program i called wctd (warp cursor to display) that just takes the desired display as argument (or the one set in DISPLAY) and moves the cursor to it. bind to some keys and move the cursor around as you like. since my x-programming-skills are severly lacking (as in virtually non-existant), i don't think either solution is perfect, but works. i hope that helps. bye christian ohm -- GREAT MOMENTS IN HISTORY (#7): November 23, 1915 Pancake make-up is invented; most people continue to prefer syrup.
Am Dienstag, 25. Juni 2002 01:13 schrieb Christian Ohm:
hi.
Hi,
i've tested your little circuit and have to say it works really well. and i've encountered the problem you described. i found two ways around it: the first is a patch to mplayer, that adds a -grabmouse option (grabmouse=0 in the config file) so mplayer doesn't grab the cursor anymore. and (by pure chance) it doesn't unpause when any key is pressed.
Do you also use the 4 modes I proposed in the original posting (2 PAL and 2 NTSC)? A friend of mine found another problem with -vm when a mode smaller than the largest is used: As soon as any key is pressed, the viewport changes! I have no idea why this happens.
the second is a little program i called wctd (warp cursor to display) that just takes the desired display as argument (or the one set in DISPLAY) and moves the cursor to it. bind to some keys and move the cursor around as you like.
I will test it this evening.
i hope that helps.
Me, too.
bye christian ohm
Magnus
On Tuesday, 25 June 2002 at 11:39, Magnus Pfeffer wrote:
Do you also use the 4 modes I proposed in the original posting (2 PAL and 2 NTSC)? A friend of mine found another problem with -vm when a mode smaller than the largest is used: As soon as any key is pressed, the viewport changes! I have no idea why this happens.
no, i just use 720x480 with 60hz (overclocked tv :) with 'aspect=1.43' in the config file. perhaps i'll change it when i get tired of having to override the aspect ratio when watching movies, but most files i currently have are 4:3. and 60hz are better than 50. bye christian ohm -- "We demand rigidly defined areas of doubt and uncertainty!" -- Vroomfondel
On Wednesday 26 June 2002 01:03, Christian Ohm wrote:
On Tuesday, 25 June 2002 at 11:39, Magnus Pfeffer wrote:
Do you also use the 4 modes I proposed in the original posting (2 PAL and 2 NTSC)? A friend of mine found another problem with -vm when a mode smaller than the largest is used: As soon as any key is pressed, the viewport changes! I have no idea why this happens.
no, i just use 720x480 with 60hz (overclocked tv :) with 'aspect=1.43' in the config file. perhaps i'll change it when i get tired of having to override the aspect ratio when watching movies, but most files i currently have are 4:3. and 60hz are better than 50. Well you should use monitoraspect=1.43 or whatever and leave the aspect value alone. If the vo you use correctly uses my aspect code, that should work fine. You could even use monitoraspect=16:9 if you own 16:9 tv.
bye christian ohm
-- Best Regards, Atmos ____________________________________________ - MPlayer Developer - http://mplayerhq.hu/ - ____________________________________________
On Wednesday, 26 June 2002 at 16:04, Felix Buenemann wrote:
Well you should use monitoraspect=1.43 or whatever and leave the aspect value alone. If the vo you use correctly uses my aspect code, that should work fine. You could even use monitoraspect=16:9 if you own 16:9 tv.
i noticed that option while playing around, and somehow it didn't work as i expected and i removed it again. but it works now - thanks for reminding me. bye christian ohm -- MESSAGE ACKNOWLEDGED -- The Pershing II missiles have been launched.
On Wednesday, 26 June 2002 at 23:34, Christian Ohm wrote:
On Wednesday, 26 June 2002 at 16:04, Felix Buenemann wrote:
Well you should use monitoraspect=1.43 or whatever and leave the aspect value alone. If the vo you use correctly uses my aspect code, that should work fine. You could even use monitoraspect=16:9 if you own 16:9 tv.
i noticed that option while playing around, and somehow it didn't work as i expected and i removed it again. but it works now - thanks for reminding me.
actually, it doesn't work. the relevant config entries should be vo=x11 vop=scale=648:-2,pp with those, monitoraspect doesn't do anything. and the manpage lists wrong options for the scale plugin (-2 and -3 aren't mentioned, just -1, which doesn't do what the manpage says, it just uses the original height iirc). bye christian ohm -- There comes a time in the affairs of a man when he has to take the bull by the tail and face the situation. -- W.C. Fields
On Saturday 29 June 2002 00:48, Christian Ohm wrote:
On Wednesday, 26 June 2002 at 23:34, Christian Ohm wrote:
On Wednesday, 26 June 2002 at 16:04, Felix Buenemann wrote:
Well you should use monitoraspect=1.43 or whatever and leave the aspect value alone. If the vo you use correctly uses my aspect code, that should work fine. You could even use monitoraspect=16:9 if you own 16:9 tv.
i noticed that option while playing around, and somehow it didn't work as i expected and i removed it again. but it works now - thanks for reminding me.
actually, it doesn't work. the relevant config entries should be
vo=x11 vop=scale=648:-2,pp
with those, monitoraspect doesn't do anything. and the manpage lists wrong options for the scale plugin (-2 and -3 aren't mentioned, just -1, which doesn't do what the manpage says, it just uses the original height iirc). vop scale doesn't use my aspect code, so it won't work. eg. -vo sdl or xv with hw scaling should fo it correctly.
bye christian ohm
-- Best Regards, Atmos ____________________________________________ - MPlayer Developer - http://mplayerhq.hu/ - ____________________________________________
Hi,
actually, it doesn't work. the relevant config entries should be
vo=x11 vop=scale=648:-2,pp
with those, monitoraspect doesn't do anything. and the manpage lists wrong options for the scale plugin (-2 and -3 aren't mentioned, just -1, which doesn't do what the manpage says, it just uses the original height iirc). vop scale doesn't use my aspect code, so it won't work. eg. -vo sdl or xv with hw scaling should fo it correctly.
hey there are 2 levels of aspect correction: prescaling (-aspect, doen before applying filters) and display aspect (-monitoraspect, done in libvo drivers where it has any sense) -aspect has effect on filters, even on scale, but scale has option to use original w/h or prescaled (aspect corrected) w/h this is the difference between 0/-1 and 2/3 A'rpi / Astral & ESP-team -- Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
On Saturday, 29 June 2002 at 17:02, Arpi wrote:
Hi,
actually, it doesn't work. the relevant config entries should be
vo=x11 vop=scale=648:-2,pp
with those, monitoraspect doesn't do anything. and the manpage lists wrong options for the scale plugin (-2 and -3 aren't mentioned, just -1, which doesn't do what the manpage says, it just uses the original height iirc). vop scale doesn't use my aspect code, so it won't work. eg. -vo sdl or xv with hw scaling should fo it correctly.
hey there are 2 levels of aspect correction: prescaling (-aspect, doen before applying filters) and display aspect (-monitoraspect, done in libvo drivers where it has any sense)
-aspect has effect on filters, even on scale, but scale has option to use original w/h or prescaled (aspect corrected) w/h this is the difference between 0/-1 and 2/3
well, it would be nice if monitoraspect would be used in the scale plugin when zoom isn't selected. right now i have a fixed aspect in my config and have to play when a movie isn't 4:3. btw, the manpage mentions -1 for scale to use the aspect ratio of the movie, but actually it is -3 for movie aspect, -2 for monitor resolution aspect (without using -monitoraspect). bye christian ohm -- Don't suspect your friends -- turn them in! -- "Brazil"
Hi,
there are 2 levels of aspect correction: prescaling (-aspect, doen before applying filters) and display aspect (-monitoraspect, done in libvo drivers where it has any sense)
-aspect has effect on filters, even on scale, but scale has option to use original w/h or prescaled (aspect corrected) w/h this is the difference between 0/-1 and 2/3
well, it would be nice if monitoraspect would be used in the scale plugin when zoom isn't selected. right now i have a fixed aspect in my config and have to play when a movie isn't 4:3.
imho it's bad, very bad idea: - it's on -vo drivers how to handle monitoraspect, more over, coming from current mplayer architecture, teh video filter layer cannot even access this info - encoding files to the aspect ratio for _your_ monitor is a bad idea, think if someone with different monitor wants to playback it... also think if _you_ want to playback it, then the monitoraspect value will be applied _twice_
btw, the manpage mentions -1 for scale to use the aspect ratio of the movie, but actually it is -3 for movie aspect, -2 for monitor resolution aspect (without using -monitoraspect).
huh? if(vf->priv->w==-3) vf->priv->w=vf->priv->h*width/height; else if(vf->priv->w==-2) vf->priv->w=vf->priv->h*d_width/d_height; if(vf->priv->w<0) vf->priv->w=width; else if(vf->priv->w==0) vf->priv->w=d_width; so: -1 -> use original (without prescaling ie without -aspect) w/h 0 -> use prescaled (-aspect value applied) w/h -2 -> calculate w from h using prescaled aspect (-aspect applied) -3 -> calculate w from h using original aspect (-aspect ignored) note that -monitoraspect is always ignored at vidoe codec/filter layer. it's, as its name says, is for video out to correct square pixels to monitor's pixel aspect. no sense and no way of calculating -monitoraspect into -vop scale. A'rpi / Astral & ESP-team -- Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
On Tuesday, 2 July 2002 at 0:25, Arpi wrote:
well, it would be nice if monitoraspect would be used in the scale plugin when zoom isn't selected. right now i have a fixed aspect in my config and have to play when a movie isn't 4:3.
imho it's bad, very bad idea: - it's on -vo drivers how to handle monitoraspect, more over, coming from current mplayer architecture, teh video filter layer cannot even access this info
yeah, i thought so.
- encoding files to the aspect ratio for _your_ monitor is a bad idea, think if someone with different monitor wants to playback it... also think if _you_ want to playback it, then the monitoraspect value will be applied _twice_
haven't thought about that, since i have used mencoder only to repair some screwed files.
btw, the manpage mentions -1 for scale to use the aspect ratio of the movie, but actually it is -3 for movie aspect, -2 for monitor resolution aspect (without using -monitoraspect).
huh?
if(vf->priv->w==-3) vf->priv->w=vf->priv->h*width/height; else if(vf->priv->w==-2) vf->priv->w=vf->priv->h*d_width/d_height; if(vf->priv->w<0) vf->priv->w=width; else if(vf->priv->w==0) vf->priv->w=d_width;
so: -1 -> use original (without prescaling ie without -aspect) w/h 0 -> use prescaled (-aspect value applied) w/h -2 -> calculate w from h using prescaled aspect (-aspect applied) -3 -> calculate w from h using original aspect (-aspect ignored)
ah, so i got -2 wrong... well, imho -2 and -3 are the most useful, and those aren't mentioned on the manpage.
note that -monitoraspect is always ignored at vidoe codec/filter layer. it's, as its name says, is for video out to correct square pixels to monitor's pixel aspect. no sense and no way of calculating -monitoraspect into -vop scale.
what about another parameter to scale, that gives a custom aspect ratio by which to scale the output? bye christian ohm -- When I'm good, I'm great; but when I'm bad, I'm better. -- Mae West
Hi,
note that -monitoraspect is always ignored at vidoe codec/filter layer. it's, as its name says, is for video out to correct square pixels to monitor's pixel aspect. no sense and no way of calculating -monitoraspect into -vop scale.
what about another parameter to scale, that gives a custom aspect ratio by which to scale the output?
it's -aspect A'rpi / Astral & ESP-team -- Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
On Tuesday, 2 July 2002 at 1:04, Arpi wrote:
Hi,
note that -monitoraspect is always ignored at vidoe codec/filter layer. it's, as its name says, is for video out to correct square pixels to monitor's pixel aspect. no sense and no way of calculating -monitoraspect into -vop scale.
what about another parameter to scale, that gives a custom aspect ratio by which to scale the output?
it's -aspect
but that doesn't use the movie's aspect. something like monitoraspect for scale. bye christian ohm -- If you do something right once, someone will ask you to do it again.
Am Dienstag, 25. Juni 2002 01:13 schrieb Christian Ohm: Hi,
the first is a patch to mplayer, that adds a -grabmouse option (grabmouse=0 in the config file) so mplayer doesn't grab the cursor anymore. and (by pure chance) it doesn't unpause when any key is pressed.
It works fine! It could be considered to add the patch to mplayer cvs.
i hope that helps.
Yes, but some other cvs commit changed the -vm behaviour. mplayer cvs (updated just now) does: -vm with -vo x11 (and -fs -zoom) renders the movie in the full desktop resolution, whether a smaller resolution/viewport is selected or not. -vm with -vo x11 (and -fs) crashes mplayer: --- cut --- XF86VM: Selected video mode 640x480 for image size 640x272. X11 error: BadMatch (invalid parameter attributes) MPlayer interrupted by signal 6 in module: decode_video --- cut --- but _not_ when I use strace to check what happens before the crash. With strace it works just fine. Funny.
bye christian ohm
Magnus
On Tuesday, 25 June 2002 at 20:04, Magnus Pfeffer wrote:
Am Dienstag, 25. Juni 2002 01:13 schrieb Christian Ohm:
the first is a patch to mplayer, that adds a -grabmouse option (grabmouse=0 in the config file) so mplayer doesn't grab the cursor anymore. and (by pure chance) it doesn't unpause when any key is pressed.
It works fine! It could be considered to add the patch to mplayer cvs.
hmmm, i don't think it worked perfectly (the option stuff in (iirc) cfg-mplayer.h for example), so someone how knows how options work should correct it first. and i don't know x, so perhaps there is a better way to do it. i just searched for something mousy and removed it.
i hope that helps.
Yes, but some other cvs commit changed the -vm behaviour. mplayer cvs (updated just now) does:
-vm with -vo x11 (and -fs -zoom) renders the movie in the full desktop resolution, whether a smaller resolution/viewport is selected or not.
i don't use -zoom, i have 'vop=scale=648:-2' in my config, so it scales to the width of the viewable part of the 720x480.
-vm with -vo x11 (and -fs) crashes mplayer:
--- cut --- XF86VM: Selected video mode 640x480 for image size 640x272. X11 error: BadMatch (invalid parameter attributes)
MPlayer interrupted by signal 6 in module: decode_video --- cut ---
i never had any crashes (with cvs from about the time i wrote the mail). but then, i haven't used -vm since i added the scale option.
but _not_ when I use strace to check what happens before the crash. With strace it works just fine. Funny.
i had that sometimes, too. annoying, and i can't remember what the problem was. but gdb should help in those cases. bye christian ohm -- So this is it. We're going to die.
Hi,
[a patch that adds a -nograbpointer option] It works fine! It could be considered to add the patch to mplayer cvs.
I upgraded to the latest cvs recently, and still mplayer does not have an option to disable mouse pointer grabbing. Christian Ohms patch still applies, and still works fine. It's extremely useful for people like me who use a multi-head X setup to watch movies on the TV. With this patch, I can work on screen :0.0 and my wife can watch divx movies on screen :0.1 and control mplayer with the remote. Without this patch, I cannot move the mouse back to :0.0 if I use the -vm option, and I need this option. Is there a special reason why this patch was not put in cvs, or did it just get ignored? Keep up your fantastic work! Magnus
participants (4)
-
Arpi -
Christian Ohm -
Felix Buenemann -
Magnus Pfeffer