ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
Re: [wxPython-users] wxMediaCtrl: QuickTime / WMP differences in handling SetPlaybackRate
by Kevin Ollivier other posts by this author
Jun 30 2006 12:49PM messages near this date
[wxPython-users] wxMediaCtrl: QuickTime / WMP differences in handling SetPlaybackRate | RE: [wxPython-users] wxMediaCtrl: QuickTime / WMP differences in handling SetPlaybackRate
Hi David,

On Jun 30, 2006, at 9:27 AM, David Woods wrote:

>  I use Python 2.4.2 and wxPython 2.6.3.2-unicode on Windows, and  
>  Python 2.3
>  and wxPython 2.6.3.2-unicode on Mac OS X 10.3.
> 
>  I need to be able to play video in a variety of formats.  I also  
>  need to be
>  able to alter the speed of video playback.  I am trying to use  
>  wxMediaCtrl
>  to do this.  On Windows, I use the Windows Media Player back end  
>  for all
>  video except QuickTime's *.mov format.  On Mac OS X, I use the  
>  QuickTime
>  back end for all video.
> 
>  When using the wxMEDIABACKEND_DIRECTSHOW back end to wxMediaCtrl,  
>  everything
>  works as I'd expect.  I use SetPlaybackRate() to change the  
>  playback speed,
>  and when I call Play(), the video plays at the speed I chose.   
>  (This is the
>  case for MPEG-1 video on Windows.)
> 
>  However, when I use the wxMEDIABACKEND_QUICKTIME back end to  
>  wxMediaCtrl on
>  either platform, the behavior is quite different.  When I call
>  SetPlaybackRate(), the media starts PLAYING at the speed  
>  indicated.  If I
>  call Stop() or Pause(), subsequent calls to Play() cause the media  
>  to play
>  at normal speed rather than the speed sent to SetPlaybackRate().   
>  (This is
>  the case for QuickTime video on Windows and all video on Mac.)
> 
>  I've attached a smallish demonstration of the problem.  If you load a
>  QuickTime video on Windows or any video on the Mac and leave the  
>  "Correct
>  QuickTime behavior" checkbox un-checked, then press the "Rate" button,
>  you'll see what I'm talking about.  If you load MPEG-1 video on  
>  Windows or
>  check the "Correct QuickTime behavior" checkbox, you'll see  
>  something closer
>  to the behavior I expect, but you can see in the code that I had to  
>  do some
>  ugly hacking to get things working, and it's still not completely  
>  right.

Just took a look and the QuickTime docs state that SetMovieRate does  
actually start playing the file when called. So what needs to be done  
is to store the playback rate in a variable when SetMovieRate is  
called. If the movie's not playing, it should just wait and call  
SetMovieRate with that value the next time Play is called. Otherwise,  
if the movie's playing, it should behave the same as before.

I'm busy with some other things at the moment, so I don't have time  
to work on and test a fix right now, but if no one gets first I'll  
try fixing it when I have some time.

Regards,

Kevin

>  A second issue that this demo program also displays is that you  
>  can't show
>  an MPEG-1 video on Windows and then load a QuickTime video.  I  
>  destroy the
>  wxMediaCtrl and create a new one to get the back end to change, but  
>  I can't
>  get the wxMEDIABACKEND_QUICKTIME back end to load a QuickTime  
>  format video
>  if a wxMediaCtrl with the wxMEDIABACKEND_DIRECTSHOW back end has  
>  already
>  been created in the Python session.  This code used to occasionally  
>  be able
>  to load QuickTime after MPEG, but now it fails 100% of the time for  
>  me.  I
>  don't know why.
> 
>  If anyone has suggestions for me about a better solution to these  
>  issues
>  than is demonstrated in my sample code, I'd love to hear about it.
> 
>  David K. Woods
>  Transana Lead Developer
>  Wisconsin Center for Education Research
>  University of Wisconsin, Madison
>  http://www.transana.org
>  <video_player.py>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: wxPython-users-unsubscribe@[...].org
>  For additional commands, e-mail: wxPython-users- 
>  help@[...].org


---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@[...].org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Thread:
David Woods
Kevin Ollivier
David Woods
David Woods
Kevin Ollivier

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved