[MPlayer-dev-eng] Fast Forward and Slow Motion Patch

Struan Bartlett struan at NewsNow.co.uk
Fri Feb 7 14:57:04 CET 2003


Dear Arpi et al,

I previously sent this email to the mplayer-users' list, but that was 
probably the wrong place.

I understand there's a feature-freeze going on, but is there any chance 
this small but useful (and hopefully uncontroversial) patch could make 
it into rc4?

With kind regards,

Struan.

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).

Instructions:

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,

_SHMB_

____________________________________
Struan Bartlett
Chairman
NewsNow Publishing Limited
Tel: +44 (0)20 7471 0400
____________________________________
http://www.NewsNow.co.uk
Online Media Monitoring

Receive fast updating news about
your company, competitors, industry,
products, clients & prospects
____________________________________

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mplayer-0.90rc3-live-ffw.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030207/8a4f324e/attachment.asc>


More information about the MPlayer-dev-eng mailing list