[MPlayer-users] Feature request: ReClock functionality

Lasse Kärkkäinen / Tronic tronic2 at sci.fi
Wed Dec 10 20:00:12 CET 2003


'lo...

As some may know, there is a plugin called ReClock for 
DirectShow/Windows. I'm asking for similar features to be implemented in 
MPlayer.


The Problem
-----------

When playing 25 FPS movie on 50 Hz refresh rate (tv-out), you'd expect 
to have each frame displayed exactly two times on your screen.

Unfortunately, due to clock differences and not having any sync between 
audio clock (used for playback timing) and video refresh clock, you'll get
* majority of frames displayed exactly 2 times, like they should
* some frames displayed only once
* some frames displayed three times

This causes easily noticeable jitter, which makes the video feel like 
bad computer video, instead of the flawless playback we are used to with 
hardware players and TV.

Some would suggest disabling "wait for vsync" to get around this 
problem. However, it would actually just make the problem worse by 
adding tearing and still not playing it back at exactly correct rate.


The Solution
------------

Do the following:

* sync playback to vsync clock instead of the audio clock
* resample audio in software or play with audio card clock, to get the 
audio keep in sync - slightly varying the samplerate as required.

Of course this is much trickier than it seems, but ReClock shows it is 
possible - and that it really is worth all the work invested.

This should work even with S/PDIF, but then you need to play with the 
audio hardware clock (no resampling is possible) and I highly doubt this 
would work with all hardware.


Extensions
----------

In the above, we used this system for playing back this video on exactly 
2x refresh. However, there is no reason not to always use it whenever 
screen refresh is roughly a multiple of video framerate. For example
* 29.97 FPS at 60 Hz, 85 Hz or 120 Hz
* ~24 FPS at 50 Hz, 75 Hz or 100 Hz
* or generally any framerate at any refresh rate, if the playback speed 
will be within some user-definable margin (otherwise fallback to regular 
playback).

Of course this causes slight distortion in sound pitch (and playback 
speed, but that is neglible), but within certain limits the distortion 
is a lesser evil than the jerky playback.


More Information
----------------

ReClock website:
http://ogo.nerim.net/reclockfilter/

ReClock documentation: (note: UTF-8 charset & removed screenshots)
http://trn.ath.cx/reclock.txt

- Tronic -




More information about the MPlayer-users mailing list