[MPlayer-users] [wxPython-users] Re: how to embed a mplayer vidio play window into wxpython
Timothy W. Grove
tim_grove at sil.org
Tue Feb 16 06:16:03 CET 2010
Dear David,
Thanks for your help with embedding MPlayer into wxPython under Windows.
It works reasonably well for me, but I've found a couple of things that
I haven't been able to work out. I started out using "-vo direct3d" for
my target driver which worked well but I couldn't get mplayer to resize
along with containing window. Fortunately, this issue went away when I
switched to "-vo gl".
The real puzzler is how to get a player window to refresh when another
window has covered it. The behaviour that I'm seeing under WindowsXP
(and Vista with 'desktop composition' disabled) is that when another
window is placed over the mplayer window and removed, it either leaves
an imprint of itself on mplayer (XP) or erases the mplayer image to a
white background (Vista). When the mplayer window is then resized or
movie playback restarted, the window will refresh itself, but I'd prefer
that the window wasn't invalidated in the first place! A further
observation is that this only seems to happen when a movie is allowed to
run to its end and the player is in an idle state. (My arguments read
'mplayer.exe -slave -idle ... ') When it is first loaded or paused
during play, then a covering window has no damaging effect. I think you
did mention something along these lines as a possible issue; have you
(or anyone else on these lists) found a possible solution? Thanks for
any suggestions.
I'm running python 2.6 with wxPython 2.8 and using the
MPlayer-rtm-svn-30521 binary from http://oss.netfarm.it/mplayer-win32.php.
Best regards,
Tim
David Bolen wrote:
> "Timothy W. Grove" <tim_grove at sil.org> writes:
>
>
>> I'm attempting to do the same thing that you were looking for and would
>> be interested to know if you were successful.
>>
>
> I'm not the OP, but I've successfully embedded mplayer, and yes, the
> window "id" is the result of GetHandle() on the window in which you
> want the output, which can be a plain unadorned wxWindow unless you
> want other functionality.
>
> Depending on how you wish to use the player you will most likely want
> to include the "-slave" option for control (use a pipe to the player
> for control operations), "-idle" so it doesn't immediately exit when
> it finishes, and "fixed-vo" so it doesn't try to close/re-open the
> output driver in between videos.
>
> Other issues may be platform specific. For example, under X,
> depending on the number of ports offered by the video card and driver
> you may not be able to have multiple mplayers all using the default xv
> driver (x11 should always work but will be higher cpu/lower performance)
>
> Under Windows, with some older mplayer builds I had a problem with the
> default DirectX driver and -wid, so tend to use the GL driver ("-vo gl").
>
> Also, window handles under Windows can occasionally be very large
> values (for no specific reason I can see), which if represented as a
> 32-bit signed value are negative. This can be tough to catch, since it
> only happens occasionally. The problem is that under older mplayer
> builds there was no way to specify such a window, since it didn't
> handle negative values properly, but restricted the input to a 32-bit
> signed range (bug 1412). As of r28785 this was fixed as long as you
> ensure you generate an unsigned value - negative wid's still aren't
> permitted.
>
> -- David
>
>
> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe, send email to wxPython-users+unsubscribe at googlegroups.com
> or visit http://groups.google.com/group/wxPython-users?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>
>
More information about the MPlayer-users
mailing list