[MPlayer-users] Live slow motion and fast forward patch

Struan Bartlett struan at NewsNow.co.uk
Thu Feb 6 20:28:08 CET 2003

Arpi wrote:

>>>I tried a short hack to mplayer, to alter the 'playback_speed' setting 
>>>while the movie is playing. It worked fine, except that audio speed is 
>>>not adjusted, and the A/V sync is lost. That's a big 'except'! I'm not 
>>>well up on the code that handles the audio (timers, etc?), but perhaps 
>>>someone else has the know-how about how to get the audio re-synced after 
>>>the playback_speed returns to 1, or how to keep it synced while the 
>>>playback_speed is > 1.
>>I thought the "-speed" option was made to do this... (?)
>yes -speed if for this
>but playback_speed is not supposed to change after playback startedm, as
>it's used to initialize audio playback (speed) too.
>A'rpi / Astral & ESP-team
So I 'improved' my hack into a draft working patch to 0.90rc3, which I 
*hope* you can find attached. Sorry I've only tested this with -vo x11 
and -vo xv. Please advise: ought I to patch this into the CVS tree myself?

A new configure options is called --enable-live-ffw, short for 'live 
fast forward and slow motion' (default enabled).


MPlayer-0.90rc3# patch -p1 </tmp/mplayer-0.90rc3-live-ffw.patch
MPlayer-0.90rc3# ./configure [with your normal options]
MPlayer-0.90rc3# make

I hope that worked.

To test it, start by running mplayer on some film.

To see what's happening, perhaps it helps to first switch on the OSD 
(press 'o' twice).

Press ']' to speed up playback first x2, then x4, then x8, assuming your 
video driver can handle the speed. You'll observe that audio is *not* 
accelerated, because this is harder to do. I've left the audio switched 
on, because it's more fun that way.

Press '[' to revert to x1 playback speed.

Now try pressing '[' to slow down playback first /2, then /4, then /8. 
Now press ']' to revert to x1 playback speed.

Reverting to x1 playback speed works by seeking to a fraction ahead of 
the current position. If you're playing an AVI, you may the timer jumps 
a little when this happens, which I imagine is because of the frequency 
of seekable keyframes (by default mencoder only puts them every 10s in a 
25fps movie).

I imagine another patch could easily mute the audio during fast forward 
or slow motion.

Hope you enjoy this,


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mplayer-0.90rc3-live-ffw.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20030206/826bd18a/attachment.txt>

More information about the MPlayer-users mailing list