_______ReClock¯¯¯¯¯¯¯Mini Table of Contents______________What is ReClock?¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Said simply the purpose of ReClock is to definitely get rid (I hope) of jerky playback of AVI and MPEG material on a PC (or a PC connected to a TV).
ReClock is born from my own frustration. I have a fast PC, a good video card, and when I play a DVD or DIVX on my brand new Home Cinema, I get dropped frames here and there for no reason, or a completely jerky and un-watch able movie. This is very annoying.
The following sections will give you a complete and I hope clear explanation of what cause jerky playback, and how ReClock will try to solve these problems.
The last section will give you the instructions on how to install and use ReClock._______________________________The not so great history of frame rates¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯
In basic terms, a video can be thought of as being made up of numerous snapshots, called frames. The frame rate is the number of frames displayed each second
As you know there exist 3 common broadcasting formats: cinema, TV, and computers
Cinema is the oldest. It is the format of the movies you see in your favourite theater. Cinema movies play at 24 frames per second ( fps). It's very simple: every 1/24th of a second, your see a new frame. This is also called progressive scan.
A television, however, does not deal with video in terms of frames. Instead, it displays video using half-frames, called fields. Each frame contains exactly two fields. One field is made up of the odd horizontal lines in a frame. This is called the odd field or the top field since it contains the top line of the image. The other field is made up of the even horizontal lines in a frame. This is called the even field or bottom field. This way to broadcast video is called interlaced scan
Now there are three common TV standards: PAL, SECAM and NTSC. All of them use interlaced scan.
Let's start with PAL, which is the European TV standard. It is also used for DVD and DIVX material. PAL material is played at 25 fps (or 50 fields per second). You see the first problem here: how can we play a 24 fps movie on a 50 fields per second PAL TV? Well first of all, we can present each movie frame two consecutive times to make the movie play at 48 fields per second. But playing the movie like this would give jerky playback every second because one movie picture would be missing. So the movie is just played 50/48 times faster to match 50 fields per second. So a cinema movie that has duration of 60mn plays on PAL in 57mn36 seconds. That's why movies you watch on your PAL TV are always a bit shorter in time.
SECAM is the French brother of PAL and works exactly the same way. It is still used in France because it gives better colours when broadcasted by radio waves (less sensitive to noise).
And now here is NTSC, the American brother of PAL. NTSC is also used for DVD and DIVX material, and plays somewhere near 29.97 fps (to be exact it is 4.5 MHz/286/525). You see a bigger problem here. How can we play cinema movies on NTSC. Accelerate them? Sure no, because you would notice that the film plays much too fast (a 60mn movie would play in 48mn3s). So NTSC engineers came with a solution called telecine or 3:2 pulldown which is quite complicated. To convert a film that runs at 24 fps to run at 29.97 fps, it is first necessary to slow down the video by 0.1% to 23.976 fps. Then approximately 6 frames are added to the video each second, bringing the frame rate to 29.97 fps. This is done by adding one extra frame to each group of 4 film frames. Although they could simply duplicate 1 out of every 4 frames to produce the extra frame, this method is not used. This is because the duplication of one frame would cause that frame to be displayed for twice as long as the other 3 frames, which leads to jerkier motion. Fortunately, film producers can make use of the field-based nature of video to more gradually introduce the extra frame. Instead of adding a whole new frame at once, 2 fields are introduced separately to each group of 4 film frames. Since 2 fields make up a frame, this method is equivalent to adding 1 new frame. However, since the 2 duplicated fields are not added at the same time, this reduces the jerkiness of the video.
Let's finish with computers. Computers are quite simple, they just do work like cinema and use progressive scan. But they use many more frame rates: 60 Hz, 75 Hz, 85 Hz, 100 Hz when watching your monitor, 50 Hz when connected to a PAL TV, and 60 Hz when connected to a NTSC TV. To obtain a smooth playback on a PC you just have to make sure that your video card uses a refresh rate that is an exact multiple of the movie you play. You can already see that PAL can be played fine at 50 Hz, 75 Hz or 100 Hz, but NTSC cannot be played without begin jerky because all we have is 60 fps which is not a multiple of 29.97 fps.___________________________The nightmare of badly born DIVX¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
DIVX for the most are created from DVD material, and DVD material generally comes from movie material.
DIVX created from PAL material are generally fine, because they were created from 24 fps material simply accelerated to 25 fps or from direct 25 fps material. PAL is a good guy.
And now you have telecine for NTSC. Since telecine can only be displayed correctly on interlaced scan hardware, it must be removed for PC playback. This operation is called inverse telecine. Doing this on a film will revert the frame rate of the movie to 23.976 fps. Funny, but jerky on every PC you will use to play the movie.
Some people that create DIVX from NTSC don't even know that inverse telecine must be done. So those DIVX stays at 29.97 fps and will have artefacts when watched on your PC because interlacing artefacts do not compress well at all.
And to add another thing to the story, some DIVX has sound and movie sync problems that are solved by modifying the frame rate a little bit so the movie duration matches the sound track duration. This is a quick and dirty way to do it. Imagine a 25 fps DIVX that is modified to play at 25.001 fps; well every 1000 frames (that's only 40 seconds) the playback will become jerky._______________________________The bigger nightmare of PC hardware¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯
When you connect your PAL DVD player to your TV, things are really simple. Your player read the movie from the disc at 25 fps, and sends the signal to the TV at 25 fps.
Now imagine that your player is a little too fast and send the movie to the TV at 25.01 fps. What will happen? Jerkiness? No In fact your TV is smart, and will stay synchronised with your player as long at the player plays near 25 fps. To be more precise no player in the world plays the movie exactly at 25 fps because clocks are never accurate. So every player play the movie near 25 fps, but this is no problem for your TV since it is locked to the video signal it receive.
Now when you play a DIVX on your PC and watch it on your PC what happens? First of all, if the refresh rate of your monitor is not a multiple of the frame rate of your DIVX, jerkiness will happen for sure. Do you remember that DIVX can be 24 fps, 25 fps, 23.976 fps, 29.97 fps, or even 25.001 fps? This is the first and main cause of jerky playback.
The other source of jerkiness is much more subtle and harder to understand. Suppose you play a 25 fps movie on you PC. Well your PC isn't smarter that any DVD player, it will play it near 25 fps because it uses its internal clock, which is inaccurate. But it should not be a problem because DVD players also do that? Bad luck, it is a very big problem, because your video card does not synchronise its speed with the speed of the movie like a TV would do with a DVD player. In a PC the clocks used in the video card (to show the video) and in the PC (to play the video) are completely distinct, thus there always is deviation between them, and then jerkiness is inevitable.___________________________The better history of DirectShow¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
DirectShow is the DirectX component that plays or record video and audio on your PC. DirectShow contains many modules called filters and connect them in a filter graph to finally render the movie.
Let's take an example, with the steps needed to play a DIVX movie:
- First you need to demux the audio and video from the AVI file: one filter will do that and will produce two streams (audio + video)
- Then you need to decode audio stream (MP3 for example): a MP3 decoder filter will do that
- You also need to decode video: a DIVX decoder filter will do that
- You must render the decoded movie in a window: a video renderer filter is needed
- You must play decoded audio: an audio renderer is used.
DirectShow was cleverly designed because it will automatically search and find what filters are the best to render a movie. For example, the audio and video renderers are completely generic (they are provided by Microsoft) and will eat the output of every decoder filter in the world.
That's one reason why there exist many DIVX players out there. A player is only a nutshell where filter graphs are built and run.
Now, DirectShow has another interesting feature. When building a filter graph, it set up a reference clock that is used to provide a unique time to all the filters in the graph. All filters will play their stuff at the speed of the reference clock.
The default reference clock in DirectShow is provided by the Microsoft sound renderer. Why? Because in order to play sound correctly, your sound card must receive samples exactly at the speed they will be played. So the default reference clock is in fact synced to a hardware clock somewhere in your sound card. Video frames just follow this clock, making jerkiness inevitable.
You may ask why Microsoft made this choice. They could have chosen to sync the reference clock to the video and all would be nice. I suppose they didn't for at least two reasons:
- Video cards do not have a high-resolution hardware timer available to make a clock.
- Sound playback would become problematic since the sound card would not receive its samples at the speed they would be played. So the sound would not stay synchronised with video_________________Here comes ReClock¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Now I think you understand what does ReClock. It provides a reference clock that is synchronised with your video hardware. How? By replacing entirely the default sound renderer with a new rewritten DirectShow filter that is somehow cleverer.
But by doing so, ReClock must solve the two problems we saw in the last section:
- Video cards do not have a high-resolution hardware timer available to make a clock: well, this is not completely true, since many of them have something that will help us. ReClock provides a reference clock based on a high-resolution timer based on hardware on your motherboard or your processor
. Let's call this clock the system clock
. Then, ReClock will correct the system clock with information gathered in real time from your video card if they are available
. How it does that will be my little secret
- Sound playback would become problematic: this is true. How can we solve that? By varying the speed of the sound in real time to force the sound to stay in sync with the video
. This is another reason why we replace the sound renderer with our own one. There are two ways to change sound speed: playback speed and pitch. Normally, ReClock will choose to change the pitch of the sound in real time by adjusting the audio clock because it's quite easy to do and does not degrade too much sound quality. It also allows very fine tuning on the video vs. sound synchronisation. This will however change a little bit the sound you will hear, but your ears should not notice that with such a low correction. Starting with version 1.4, you can also ask ReClock to combine audio pitch change with audio time stretching witch allow to change the playback speed without noticeable pitch artefacts.
Another thing that does ReClock is to change the global playback rate of the movie in order to match its frame rate to a multiple of the refresh rate of your monitor
. Here is how it does that:
- CINEMA mode is detected if the monitor has a refresh rate that is a multiple of 24 Hz (72 Hz, etc) and if the movie has a frame rate between 23.75 and 24.25. Then the playback rate of the movie (including sound) is modified to match exactly 24 fps.
- PAL mode is detected if CINEMA mode wasn't possible and if the monitor has a refresh rate that is a multiple of 25 Hz (50 Hz, 75 Hz, 100 Hz, etc) and if the movie has a frame rate between 23.75 and 25.25. Then the playback rate of the movie (including sound) is modified to match exactly 25 fps.
- NTSC mode is detected if the monitor has a refresh rate that is a multiple of 30 Hz (60 Hz, 120 Hz, etc). Then the playback rate of the movie (including sound) is modified to match exactly 30 fps.
- CUSTOM mode is detected when the frame rate of the movie +/- 2% is a multiple of the monitor refresh rate. Then the playback rate of the movie (including sound) is modified to match exactly a multiple of the monitor refresh rate.
Finally if nothing matched, ReClock will try to match the playback rate is not modified, but the reference clock is still synchronised to the video card in order to obtain a stable clock.
Side note: you may ask if NTSC will work well with TV since PC does 30 fps where the TV wants 29.97 fps. That's a good question to which I do not have a complete response, but strangely I observed that when I use ReClock with the excellent TvTool in NTSC mode with a GeForce 3, I get a clock correction that make the reference clock work near 29.97 fps. So it seems that when the PC uses TV out in NTSC mode, the refresh rate is not 60 Hz, but 29.97*2 Hz, but I'm not sure at all of that, since it may be a coincidence. Anyway playing NTSC at 30 fps on a NTSC TV should not be a problem; as you may know NTSC was originally a black/white standard at 30 Hz that became 29.97 Hz for technical reasons when colour appeared.So by adjusting the reference clock to match your video card, adjusting the sound to stay in sync with picture, and modifying the global playback rate, ReClock should allow a smooth movie experience on your monitor and even on your TV
But as I said before, ReClock will not work with all PC because it uses some functions that are not available on all of them. Firstly your PC must support high-resolution timers (nearly every modern PC has them). Secondly, your video card must support some special calls. I know that most nVidia, ATI, Intel i815 and Matrox G200 do support those calls, but some cheaper or older cards may not. If those functions are not supported, ReClock will not load at all or will display an error message and the Microsoft audio renderer will be used.
Moreover, ReClock has some constraints you need to understand:
- ReClock requires DirectX 9.0 or later.
- ReClock will load and work only if your movie has sound, because ReClock is an audio renderer.
- ReClock will not always find the frame rate of the material. For example streaming will never be supported.
- When your run ReClock for the first time for a specific resolution and refresh rate, the reference clock will be inaccurate during the first minutes of playback while being corrected. This can cause jerky playback at the beginning of the movie. The time to obtain an accurate clock will depend on many factors (initial error of clock, PC speed ). During this period, you will see a flashing yellow/red icon in the system tray. After this adjustment the icon will become green (or yellow), and ReClock will store the correction in the registry, so when you will open another media, the clock correction parameters will be retrieved.
- Changing the playback speed can be noticeable on sound especially when 23.976 fps material is up rated to 25 fps. Doing so will accelerate the sound by 4%, and sound will seem to be a little high pitched. If you don't like that, you can enable the audio time stretching function (explained later in this document)._________________________Let's be a little more technical¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Now that you know what DirectShow is and what does ReClock, I will explain here some technical knowledge that will be useful to fully use ReClock.
Originally, Microsoft designed one DirectShow audio renderer called the WaveOut renderer. This renderer was based on an old audio technology dating back to Windows 3.0 (let's call it the Wave API). Later, when DirectX started to emerge, Microsoft designed a new audio renderer called the DirectSound renderer which is based on DirectSound technology (the DirectSound API). The later should provide better sound quality with less CPU overhead and less latency. On a normal PC with DirectX 9.0 or later, the DirectSound renderer is generally automatically used.
At the same time DirectSound emerged, PC started to be used to play DVD's. As you know, nearly all DVD's have a 5.1 Dolby or DTS soundtrack (i.e. 6 independent audio channels), that can be played on multiple speakers by your PC and the appropriate audio card, or send to an external AC3 decoder/amplifier with an SPDIF compatible soundcard. You can see those are two different ways to handle sound. When you play some media (MP3, DIVX, and DVD) and your soundcard provides directly the sound to the speakers, you are using PCM (Pulse Coded Modulation) sound, and I will call this PCM mode. When you are sending an AC3 or DTS stream over SPDIF to an external decoder/amplifier you're doing AC3 pass-through mode, and I will call this SPDIF mode.
PCM and SPDIF modes are very different by nature:
- In PCM mode, ReClock receives the raw audio waves in digital form and transmits them to the audio card, but it can tweak them because it understands what is inside. So the sound can be reshaped (pitch or playback rate can be changed, and dynamic compression can be applied). Altering the playback rate allows ReClock to re sync the sound with the video. Playing a video at 25 fps with a sound that was designed to play at 24 fps is no problem.
- Now in SPDIF mode, ReClock receive a binary encoded AC3 or DTS stream and transmit it to the external decoder/amplifier via SPDIF link. But it can't understand what is inside because this content needs to be decoded to be understood and played (that's the purpose of an AC3 decoder). So how can ReClock alter the playback rate in SPDIF? Well, in fact it can't do it nicely. AC3 frames are divided into chunks that have a sound duration of 32ms (a chunk is also called a frame or packet). Each frame is independent of the previous and of the next. To shorten the sound, ReClock drop frames, and to lengthen the sound, ReClock repeat frames. This is called the drop/repeat algorithm. Usually dropping or repeating an AC3 frame is not noticeable if it does not happen too often (remember a frame is only 32ms long), but it is not possible to play a media at a speed that is very far from its original speed (playing a 24 fps file at 25 fps would make a frame drop every 25 frame and it is very noticeable). That's why in SPDIF mode, ReClock will only accept to alter the speed of media files very slightly (it won't try to accelerate a 24 fps file to 25 fps).
Now DirectShow also have its oddities. When the WaveOut renderer was the only way to play sound, it was extended to handle SPDIF so it could take PCM or SPDIF input. When the DirectSound renderer appeared, it was plagued with problem in SPDIF handling, and many audio card manufacturers also had problems to handle SPDIF with DirectSound. So, this renderer is not commonly used to handle SPDIF. From this, you see that the best way to handle PCM sound is to use DirectSound and the best way to handle SPDIF sound is to use WaveOut. So, as ReClock needs to handle both PCM and SPDIF modes, it provides you the two worlds: WaveOut API and DirectSound API, so you have the choice. In this regard, ReClock is a hybrid audio renderer. Please have a look on a section How to optimize SPDIF output for a method that will allow you to minimize drop/repeats in SPDIF mode.
Version 1.6 also comes with a new audio renderer called "Kernel Streaming". This API is the lower one available in Windows to produce sound. It talks directly to audio WDM cards drivers, and has many advantages :
- lower possible audio latency
- complete bypass of the windows internal audio resampler that degrades sound quality
... and some disadvantages :
- no audio volume control
- will not work with every soundcard in ReClock especially when streaming AC3 sound
So if you want top notch audio quality, you can use Kernel Streaming with ReClock.
Let's now speak about video renderers inside DirectShow. Just like for sound, Microsoft made with time different versions of video renderers:
-*First the Old renderer: it uses old video technology is slow and should not be used anymore.
-*Then the Overlay mixer came: this one uses overlay capability of video cards based on DirectDraw. Overlay is a technology that allows an application to display efficiently and with good quality pictures on screen but it has limitations: not all cards can do it, and you are limited to one video on screen (one overlay) at one time; also overlay can cause problems when using TV output. Besides its limitations, the overlay mixer is still widely used today
-*When Windows XP came out, the Video Mixing Renderer appeared, also called the VMR7: this one is based on Direct3D, and has no limitations. But your card must be able to handle it (recent card and recent drivers). VMR7 is used by Windows Media Player on XP.
-*And finally when DirectX 9.0 appeared, a second and distinct version of the VMR came out and this one is called the VMR9: it is an up rated VMR7 renderer with even more capabilities. You must use a good player if you want to try this one (for example Zoom Player)
-*Some players like BSPlayer have their own video renderer (based on overlay for BSPlayer).____________________________Installing and configuring ReClock¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Installation is straightforward; simply launch setup.exe. This will install the product in C:\\Program files\\ReClock by default. You will also notice a new menu in the start menu. This menu will give you access to this read me and uninstall utility.
Un-installation is simple too. Simply uninstall ReClock from the add/remove program' panel of Windows or from the ReClock menu. Do not delete ReClock folder or un-register it manually, it would not uninstall it correctly! If you did something wrong to uninstall it, just reinstall and uninstall ReClock with the normal procedure and all will be well.
Now you can use the configuration application to modify some settings. You can launch it from the Start menu.
Here is an overview of the configuration application:
If you don't know what to choose or if you messed up things, click on Advanced settings, then click on Restore default settings, then click on Clean-up video timings database, then go to Video settings and click on Clean-up manual frame rate database, then click on OK, and all default settings and parameters will be restored.
Let's first have a look on the Audio settings tab. Here you will configure all sound related parameters:
- Devices to use with DirectSound/Kernel Streaming/WaveOut: You can choose here what specific soundcard must be used when using DirectSound, Kernel Streaming or WaveOut. Use this if you have more than one soundcard, or if you use a specific card for SPDIF.
- Audio interface to use for PCM sound: Here you can choose between DirectSound API, Kernel Streaming API, or WaveOut API to play normal sounds (PCM). DirectSound is the preferred choice for PCM, but highest audio quality is only possible with Kernel Streaming.
- Audio interface to use for SPDIF/AC3 sound: Here you can choose between DirectSound API, Kernel Streaming API, or WaveOut API to send AC3 sound over SPDIF. WaveOut is the preferred choice for SPDIF.
- Sound pre-buffer size: this is the amount of sound to bufferize before to play it. The lower it is, the faster you can seek inside media files. But high values also give room to handle properly sound speed variations and speed problems. Values under 100ms are not suggested.
- Max latency for PCM/SPDIF: You can specify here, how much sound desynchronisation is accepted on PCM or SPDIF mode between sound and video. If you experience some sound drops here and there you can try to increase the values here. Values are expressed in percentage of pre-buffer time.
- Resampling quality: Resampling the sound is a process that will degrade hearing quality. But you can tweak this by enabling ReClock to use more CPU to degrade less audio. Higher resampling quality will use more CPU. "Very good" and "excellent" settings will eat CPU but audio resampling will be very very good even for audiophiles.
- Accept old multichannel formats: This option was made especially for some audio cards like the Vortex2 that don't understand special commands to handle more than 2 audio channels. If you have one of those cards, enable this option only if you get no sound at all in multichannel mode.
- Set ReClock as preferred renderer: if checked, ReClock will load in place of the default Microsoft DirectSound or WaveOut renderer for every media file you will play (this also apply for MP3 files played with Windows Media Player). If unchecked, you will have to configure your player to make it use ReClock. Media Player Classic and ZoomPlayer can do that (see the FAQ on my website to configure them).
- Force ReClock to be loaded in place of default DirectSound/Wave renderers: sometimes players explicitly ask DirectShow to play audio with a Microsoft renderer, and in this case you can't benefit from ReClock advantages. If you check this setting, ReClock will bypass that, and be loaded even if the player requested the DirectSound or WaveOut renderer (for example Windows Media Player will play DVD with ReClock, TheaterTek DVD player too, and Windows Media Center Edition too). As you can see this is quite a dangerous setting that should only be used on a PC dedicated to media playback (like a HTPC).
- Force ReClock to be loaded in PowerDVD: same trick, but for the PowerDVD player. This player normally relies on its own internal audio renderer. Just as with DirectSound/Wave renderers, ReClock can bypass this and load in place of PowerDVD internal renderer. The same warnings apply that those with the same trick for DirectSound/Wave.
- Enable audio time-stretching: if you check this setting, ReClock will be able to change the media speed without altering the sound pitch (this is called time stretching). This is a very cool setting that will allow you to watch a movie at half or twice it's original speed without getting strange voices (chipmunk, etc ), or compensate for PAL speedup voice alterations. You can ask ReClock to enable this when the media is slowed down, accelerated or both. The reason time-stretching was made optional is that it will degrade slightly audio quality.
Now let's have a look on the Video settings section. Obviously, here you will configure all video related parameters:
- Hardware access method: this will give you control over which method ReClock will use to gather clock information in real time from your video card. Direct3D is the preferred method to use, but if you experience strange lockups or if ReClock doesn't work at all, you may want to try DirectDraw.
- "Monitor detection method" : in multi-monitor environnement you can let ReClock guess on which monitor is playing media, or force ReClock to think it is using a specific monitor. Automatic is the preferred mode.
- Determine frame rate of media files using DirectShow: ReClock needs to know the frame rate of video files played in order to handle them, and DirectShow provides such mechanism. This setting doesn't apply for DVD however. If you uncheck this option, ReClock will not use DirectShow to determine the frame rate. This can be useful because in very rare cases DirectShow can be inaccurate.
- Determine frame rate of media files using built-in estimator: this is the second way to determine frame rate (if DirectShow didn't found it or was disabled). This setting applies only to non DVD material. If you uncheck this option, ReClock won't try this method with media files. If this is the case, you can propose a default value in the textbox under or leave it unknown. Then you will be able to adjust manually the frame rate in the properties panel of ReClock during playback.
- Determine frame rate of DVD using built-in estimator: the same setting as the previous but only for DVD material. Now when frame rate is not found for DVD, you can propose a default value in the textbox under or leave it unknown. Then you will be able to adjust manually the frame rate in the properties panel of ReClock during playback.
- Accepted slowdown/speedup of media speed in PCM mode: this will tell ReClock by which margin the movie can be accelerated or slowed to match a multiple of the current refresh rate. This only apply when PCM mode sound is used (i.e. not SPDIF where margin are internally fixed to much lower values because SPDIF sound can't be stretched). The default settings allow ReClock to do PAL speedup (i.e. playing 23.976 fps content at 25 fps which is a 4.2% speedup). You can prevent it from doing so by putting 1% speedup instead of 5%.
- Enable guessing a better media speed when hardware refresh rate do not match: this setting will change ReClock behaviour when it can't change the media speed to be an exact multiple of the refresh rate (i.e. yellow icon). If you check this, instead of playing the media at its original speed, ReClock will change its speed to match the refresh rate multiplied by 2 or 3 (if possible within the speedup/slowdown margins you specified in the previous setting). For example, if you play a 23.976 fps media file on a 60 Hz display (this is 2.5025025 frames per video refresh cycle), it will be speeded up to 24 fps (this is exactly 2.5 frames per video refresh cycle), because 24 is a multiple of 60x2. Enabling this setting will allow you to use the VSYNC tools in yellow icon conditions (see paragraph Using VSYNC Tools), and will improve playback experience (more regular stutter).
- Clean-up manual frame rates database: pushing this button will erase all remembered frame rates you have ever entered in ReClock properties panel.
Now let's have a look on the Advanced settings section:
- Enable VSYNC correction with VMR9, Enable VSYNC correction with other renderers: please see paragraph Using VSYNC Tools.
- Give high CPU priority to player: if enabled, higher CPU priority will be given to the player currently hosting ReClock. It is likely to give smoother playback if some background tasks are running on your PC while you watch a video.
- Do not show icon in tray: if the little clock in the tray bother you or is not compatible with your playback environnement, then check this box.
- Enable events notifications: if enabled, ReClock will launch the file named RunEvent.vbs in the ReClock install directory, each time a media file is about to be played or stopped, when playback condition have changed, or when quitting the player. You can customize this script to do whatever you want, for example to change the monitor refresh rate when it does not correspond to the one of the played media file. For convenience, the distribution of ReClock provides a sample called RunEvent.sample.vbs. For more explanations have a look inside this sample, and don't forget to modify it properly and to rename it to RunEvent.vbs before to use this feature.
- Enable logging: when checked enable a debug log to be produced in c:\
eclock_log.txt while ReClock runs. Use only for bug tracking because it can slowdown ReClock or fill your disk.
- Disallow/Allow ReClock to load with.../Don't restict : here you can provide a list of applications names in which ReClock won't be allowed to load (without extension and separated by a ;) or only allowed to load with (depending of the allow/disallow setting). When ReClock is not allowed to run with an application, it will force Windows to revert back to default audio renderers. However this setting does not apply when ReClock has been forced to load in place of DirectSound, Wave, or PowerDVD renderers (see related settings). For example, if you don't want Internet Explorer to use ReClock then simply click on "disallow" and put IEXPLORE in the list. Also, if you use some video capture application in which ReClock interfere with capture you may want to use this feature. To obtain the name of an application simply have a look in the properties panel when ReClock is loaded in that application.
- Clean-up video clock timings database: for each resolution, and video refresh rate, ReClock keeps track of what correction to apply to the system clock to make it match the video clock speed. For his purpose it uses an algorithm that will slowly converge to the proper correction values and then it will store those correction factors in the registry. Pushing this button will allow you to erase those correction factors in the registry. Doing so will then force ReClock to rerun the correction algorithms, for each resolution and refresh rate combination. Use this if you don't see the ppm indicator going low after some time. Also it is a good idea to erase those settings, after having tweaked the video timings with Powerstrip.____________Using ReClock¯¯¯¯¯¯¯¯¯¯¯¯
Now how do you use ReClock? Simply by launching your favourite Media player (like BSPlayer, ZoomPlayer, or WMP). If all goes well, your movies should play normally and sound should be working and synced to the video.
You can see what is doing ReClock by accessing its control panel during playback. You have access to this panel by double clicking the tray icon or from the filter list in your player (it's easy with BSPlayer and ZoomPlayer).
Speaking of the tray icon you will see it can have these colors combinations:
- Green: all is fine, ReClock found the frame rate (or it was specified manually), and is currently adapting the speed if necessary
- Flashing between Green and Red: same that Green, but ReClock has not yet found the good system clock correction to apply. Icon will go green in a few minutes, but during this playback may stay jerky.
- Yellow: ReClock cannot find a suitable speed adaptation (for example the video card refresh rate is not a multiple of the frame rate).
- Red: ReClock didn't found the frame rate, or clock correction has been disabled
Here is an overview of the control panel:
The Media infos group box will give you information about the media that is currently loaded in the player and the player name. If the filename or the video stream frame rate can't be determined, no adaptation will be made on the frame rate to match your video card refresh rate. Here you will also be able to enter frame rate manually if ReClock didn't find it (and this will be remembered)
The Video hardware group box gives you information about your video card. You will get here very important indicators
, because all the work that ReClock to properly resync video is based on those. First, the Display line should tell you the current resolution and refresh rate that have been detected by ReClock. If your video card can handle more that one display, it well also tell you how many monitors have been detected, and on which monitor the media is currently being played (the monitor numbers are the same that you see in your display configuration panel).
Example: 1024x768@75 (2/3) means: you have 3 monitors, and I'm playing back on number 2 which use a resolution of 102'x768 at 75 Hz.
Please note, that ReClock will always resync the video with the monitor on which the playback window of your media player is placed
. If you drag your playback window from one monitor to another, ReClock should detect the change and react accordingly (resolution and refresh rate should match your settings). If this is not the case, try to switch between D3D and DirectDraw API in the configuration application.
The Refresh rate line will show you another refresh rate that is close to the current display monitor one but will change over time and will stabilize to a value that tells you what real refresh rate your video card is using (this should closely match the one given by a utility like Powerstrip). You will also see what API ReClock is using to gather video clock information from your video card (DDR means that DirectDraw is currently used to do this job, where D3D indicates that Direct3D is used). Direct3D is the preferred method to use, but if you get lockups when playing something with ReClock, then you may want to give DirectDraw a try (all versions of ReClock prior to 0.99k were using only DirectDraw). You can configure this with the configuration application.
The Renderers infos group box gives you information about which video renderer you player is using for video, and what API is used for audio (either WaveOut or DirectSound).
The Clock corrections group box will tell you what is done by ReClock to correct the system and audio clock. The ppm indication gives you indications on how accurate your system clock is (the closer to 0, the best). A 1 ppm means 0.0001% of clock deviation. For example, if your clock is 3.5 MHz, and if you play a 25 fps movie you will loose a frame every (1000000/25/3.5) second (that's around 3 hours). For the sound part, the sync indicator tells you what is the current desynchronisation between picture and sound (this should always be close to 0ms). The pitch indicator tells you by which quantity the sound pitch is currently modified (less than 1 if sound is low pitched, more than 1 if high pitched). The stretch indicator is only visible if you enabled audio time stretching in the configuration application (less than 1 if sound is slowed down, more than 1 if sound is accelerated). You also have the ability to disable completely the system and audio clocks adaptation using the checkbox slave reference clock to audio. Doing so, ReClock will work much like the default DirectSound audio renderer, but rate adaptation will still function and reference clock will be slaved to audio clock with a smooth algorithm. Anyway, remember that you will probably experience jerky playback again by checking this checkbox, so the recommended way to use ReClock is to leave it unchecked
The Media adaptation group box will tell you what adaptation is done to the video to match your hardware. You have the choice between different modes:
- Auto: this is the normal way to use ReClock. In this mode, ReClock will correct the speed of the media to match a multiple of your video refresh rate. If your video refresh rate does not correspond to the video, ReClock will indicate you what to do under the combo box.
- Original speed: in this mode, you can override the speed chosen by ReClock and play the media at its original speed.
- Nearest integer speed: this will round the frame rate to the nearest integer value.
- Other speeds: you can choose any target frame rate you want based on original media speed or on the refresh rate of your monitor. Audio will stay in sync (quite funny at 50 fps).That's being said I repeat that the best and normal way to go is to choose Auto.
You will also see a little check box labelled Locked near the media adaptation choice. If you check this button, you will force the settings used by ReClock. For example, if you have a 60 hz display, and have 24 or 25 fps media to play, you may choose Refresh rate / 2.5 and lock it, so all media would play at 25 fps even if this is not a multiple of 60 Hz.
The Sound adaptation group box will give you more control on sound:
- You can enable hardware resampling (by your soundcard) of sound instead of software resampling. Hardware resampling gives better sound quality (no degradation in quality at all), but due to some limitations of some soundcards, it may not work well on all of them (you may experience sound desynchronisation). That's why it is not recommended.
- You can mute sound if you want. If the player does not handle properly media files with multiple sound tracks, then you will get one ReClock instance for each track, but this option will at least allow you to mute unwanted sound tracks.
- You can enable the PAL speed down algorithm. This setting is only available if you have enabled audio time stretching in the configuration application. If you check this, ReClock will perform a 4.25% pitch reduction of the sound to counteract the speedup of some NTSC DVD to PAL conversions on which sound is high pitched by a margin of 4.25%.
- You can enable or disable the dynamic range compression for sound. This is an algorithm that will try to make the sound volume more constant. You will see which gain is applied to sound, and how many samples were clipped (saturated). You can also choose how strong the effect of the compressor is with the combo box (light, normal, and strong). Normal level is suggested.
The VSync adaptation group box will give you control over the VSYNC tools. Please see the paragraph Using VSYNC tools for more instructions.______________________Using TV out with ReClock¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
First of all, if you have a dual head video card (a card capable to display different
images on your monitor and on your TV at the same time like a Radeon for example), setup your TV as the primary display or make sure that the player playback window is located on the monitor that will handle TV out (normally the secondary monitor
). Don't use theater mode. Then activate TV-out.
If your card needs a utility (like TV Tool), launch it and activate TV-out.
Then, launch your media player and open a media file, and check that the hardware video refresh rate detected by ReClock is:
- 50 Hz if your TV is in PAL
- 60 Hz if your TV is in NTSC
If the refresh rate detected by ReClock is not equal to the refresh rate of your TV, then ReClock is not compatible with your video card or it did not detect correctly the display device (have a look on your properties plan in Video hardware to check that).Important notice
: if you need to adjust the size or the position of the TV image with the control panel of your video card (or TV Tool), remember to quit and restart your media player after
you have made your adjustments, because ReClock will need to estimate how the hardware video clock has been affected. If you don't do that, you will experience jerky playback. If you did something wrong, you can ask ReClock to relearn clock corrections by hitting the Clean-up video timings database in the configuration application.
As of now ReClock is known to work fine with the following cards:
- GeForce 2/3 cards with TV Tool, or with built-in drivers
- Radeon cards with built-in TV-out
If you are not sure if ReClock does correct the good video clock on your hardware, you can use the VSYNC tools to check that if this is the case or not. See paragraph below.___________________Using the VSYNC tools¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
ReClock is able to make sure that the video frames are rendered at a speed which is an exact multiple of the video refresh rate. But we have another problem to face: vertical synchronisation (VSYNC) versus movie frames synchronisation. The VSYNC is a signal or an impulsion that marks the start of a new frame on a TV, monitor, or projector.
Each time the video renderer draw a frame on screen it usually try to start drawing if it know it will be able to draw the entire frame during a video frame period. If it's not the case, it will wait the next video frame (also called vertical sync or vertical blank or VSYNC), before to continue drawing. If by bad luck each frame comes near by a VSYNC, you will get permanent jerky playback because sometimes the renderer will choose to wait next VSYNC and sometimes not depending on how late the frame arrived.
ReClock tries to eliminate this problem by making sure that VSYNC will not happen at the same time as frame arrival in the renderer.
- If you want to enable VSYNC correction, you will have to check that it is enabled in the configuration application (see Enable VSYNC correction with VMR9 and Enable VSYNC correction with other renderers). You have the choice to enabled it for all renderers, or all renderers but VMR9, or only with VMR9 (more on that later)
- It will activate only if the adapted media speed is an exact multiple of the hardware refresh rate (for example a 23.976 fps movie on 75 Hz TV), or if you checked Enable guessing a better media speed when hardware refresh rate do not match an exact multiple of the hardware refresh rate x2 or x3. Since VSYNC/Frame synchronisations issues will only happen when one have a common multiplier with the other, there is no point to use the VSYNC correction when it's not the case.
The VSYNC tools have three distinct purposes in ReClock:
1) They can show you on screen when does VSYNC happen. To enable this function check Show VSYNC on screen. You should then see on screen some points making a vertical pattern. Each point corresponds to a VSYNC that occurred during the last 100 frames played. You will also see a little horizontal line in the middle of this packet (I will call it the VSYNC bar). This is the current estimation of VSYNC position made by ReClock. Now what to learn from this? Many things:
- The height of the packet gives you an indication on how regularly frames are delivered to the renderer. If the packet height is low (10-15% of the height of your movie excluding black bars), then your playback is likely to be good.
- The position (given by the VSYNC bar) of the packet is important. There are some positions of the bar that are likely to give jerky playback because these positions correspond to instants when frames are presented to the renderer during VSYNC. Please see (3) for a solution to this
- The movements of the little VSYNC bar are very instructive. If it stay quite steady during playback (not traversing the screen completely to come back on the other side), it means that frames are presented to the renderer at a very exact multiple of the refresh rate. So it means that ReClock use the good hardware clock to make its work. This is the way to validate ReClock on multi-headed displays.
2) They can tell you if your playback is jerky or not. For this enable Tearing test in the properties panel. You will then see a vertical bar moving from left to right incrusted in the video. If you see the bar broken vertically somewhere, then it means that the renderer is displaying 2 frames at the same time (buffering problem). You should then choose another renderer (see your player options) or try another player. If you see the bar changing speed, or stopping/restarting, then it means your video is jerky. There can be many reasons for this
- Your CPU is not powerful enough to play the video smoothly
- Frames are presented during VSYNC. See (3) for a solution to this
3) They can tweak the reference clock to shift frame presentation in the renderer when frame come at a bad moment (during VSYNC). If you checked Enable VSYNC correction in the VSync adaptation group box of the properties panel, or selected this in the configuration application you will enable this function. Doing so, you will see two more little horizontal bars on the left of your video. Those are the limits that are given to the VSYNC bar. Each time the VSYNC will go outside these limits, ReClock will fine tweak the reference clock to make it go back within limits. This micro-correction has no impact on the overall smoothness of the movie playing back and will ensure that you won't get jerky playback. As said in the previous paragraphs, some VSYNC bar positions are likely to give jerky playback. From my experience, those positions depend on your system. That's why you can choose the limits you will give to the VSYNC bar by tweaking the slider called Target VSYNC position in the configuration app.
Here is the procedure to find the good settings:
- Launch configuration app, check the two Enable VSYNC Correction, and choose left position as target for VSYNC position
- Launch your player, choose a video to playback, and enable Tearing test. If the test bar does not stutter, then quit your player and move the target VSYNC slider a little further on the right. Repeat this until you get a stuttering bar
- You have now found a target position that give jerky playback. Now simply move the slider one half of its size away from the current position (left or right, it's not important), and you should be fine. For example: ? would become ?, ? would become full left or full right, etc
However depending on the renderer filter that is used, the VSYNC correction may fight against similar algorithms implemented inside the renderer itself. Here is the situation I saw with the common renderers (but I believe it can be all different with other hardware than mine):
- VSYNC correction will be disabled with the internal renderer of BSPlayer
- Overlay mixer: does work fine
- VMR7: does works fine too
- VMR9: this renderer seems to have an internal way to do the same thing and will somehow work against the VSYNC correction algorithm of ReClock. That's why you can disable VSYNC correction for this renderer in the configuration application if you want.
You may want to try the VSYNC correction with different players. The two best players I know of are ZoomPlayer and Media Player Classic as they both allow you to choose which video renderer to use._________________________How to optimize SPDIF output¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
As said before, SPDIF mode re synchronize the sound with the video part by dropping or repeating AC3 frames which can be unpleasant to the ear.
What can we do for this? First of all, try to play media files that do not need to be reclocked by a wide margin. For example, forcing a 24 fps file to play at 25 fps, will result in massive drop of 4% of samples which is too much and should be avoided.
Now, please follow these guidelines:
- if you want to play a file at 23.976 fps (NTSC progressive DVD) or 24 fps, put your monitor or projector at 48 Hz or 72 Hz, or 120 Hz
- if you want to play a file at 25 fps (PAL DVD), put your monitor or projector at 50 Hz or 75 Hz or 100 Hz
- if you want to play a file at 29.970 fps or 30 fps, put your monitor or projector at 60 Hz, or 120 Hz
- if you don't fall into one of these categories, use the media adaptation called refresh rate / x with x giving the least speed difference for the file. For example if you want to play a progressive NTSC DVD (23.976 fps) on a NTSC TV (60hz), you should choose refresh rate / 2.5 that will reclock the movie at 24 fps.
Now you have setup properly you media adaptation, there is something we can do to improve things a little bit. We can fine tune the hardware refresh rate of your video card to make it closer to the clock of you audio card, and this will minimize the number of audio drops and repeats. To do this, you need a tool called Powerstrip which is available on www.entechtaiwan.com
The procedure is a bit tricky and should be tried by people that know what this stuff mean J
Step 1: setup your hardware properly, and choose the video refresh rate on your video card
Step 2: launch configuration application, and hit Cleanup manual frame rates database
Step 3: launch your favourite player and start playback of your media with AC3, set media adaptation as needed. Now wait for the ppm indicator to stabilize to a very low value (under 10 ppm)
Step 4: stop playback, and start it again for 30 minutes. After that, you can see in the properties panel a count of AC3 frames dropped or repeated.
Now make this little computation:
E = number of sample repeated ? number of sample dropped
RATE = ( (1000 x 60 x 30) + (E x 32) ) / (1000 x 60 x 30)
Step 5: quit your player
Step 6: launch Powerstrip and go to Display profiles -> Configure -> Advanced timing options and check Ultra fine geometry. Now have a look on the refresh rate indicated by Powerstrip. Multiply this number with the RATE value you computed before, and modify it with the new value
Step 7: launch configuration application, and hit Cleanup manual frame rates database
Step 8: go back to step 3, and repeat the tests, until you find and optimal refresh rate value in Powerstrip
PS: as an alternate method, instead of recomputed each time the refresh rate with the RATE value, you can increase it by little steps if E > 0 or decrease it if E < 0.