facebook pixel Why software genlock at 60 FPS does matter! | ArKaos Pro
By ArKaos Team
on 01 Sep 2009 12:00 AM
  • development
  • mediamaster
  • optimization
  • quicktime
  • synchronization
  • visuals

MediaMaster 1.1 brings important modifications to our video engine and particularly how the video synchronization and multi threading decoding is processed. It has been optimized to perform what can be called “software genlock” in order to ensure the best possible fluidity on computers equipped with multi core processors.

The genlocking we refer to is the action of locking the frequency of a media to a reference signal or clock (check out the related wikipedia article for a complete explanation).

Let’s examine quickly the process of displaying frames. Roughly, 3 steps must be acheived:

  1. get video frames from the disk
  2. upload them to the graphic card
  3. do the composition / blending of the layers and  present them to the display

Now let’s describe how these steps are achieved without genlock and with genlock:

Without genlock:

At each new monitor frame, the software finds if a new movie frame needs to be processed. If so, it starts working sequentially through the 3 phases. The problem is that the time necessary for a codec to read the data from the disk and convert it into a decompressed frame is not constant and might, in some cases, even be quite lengthy. Mutliply this by 8 (once for each layer), add composition and effecting to it and you end up with a process that is highly variable, and might sometimes take more time than a monitor frame (typically 1/60th second), which creates fluidity problems.

Let’s illustrate this process with a graphic to make it easier to understand; in a classical real-time video processing application this will work like this:

The above graph shows an application trying to play a video loop encoded at 30 fps on a monitor running at 60 fps. In a perfect world the application should present each frames of the movie exactly twice.

There are 2 problems with this “traditional” way of doing the video processing:

  • The time base of the computer is different from the time base of the graphic card. This means that even an extremely powerful computer will display video with small hiccups once in a while because the time you use to compute movie frame is not exactly synchronized with the time it’s going to be shown, introducing ajitter effect.
  • When the software start working to display a new frame it has only in this example 1/60th of second to read a video frame, upload it to the graphic card and display it. The available time depends on the monitor fps and not on the video source fps. Which means that, the higher the fps of the monitor, the more stress you give to your system.

With genlock:

The processing done by MediaMaster 1.1 is much more efficient. Three different engine accuracy modes are now available to the user in the preferences dialog: “Minimal” was the default mode in MediaMaster 1.0, “Frame Blending” another new option in version 1.1 which we will discuss later and “Buffered”, which is the subject of this article.

In Buffered mode, the software keeps a predictive buffer that stacks frames that will be needed in the future. As soon as a frame has been decoded, it evaluates what are the next frames that are going to be needed later and queues their decoding directly. This process is running in the background and is separated from the monitor lock needed to present frames without tearing. Whenever the software needs a frame to display, it takes it from the buffer that was prepared upfront.

Also, in buffered mode the content syncs with the monitor frequency rather than with the computer clock. As far as I know, very few other media players are capable of doing something as subtle as this.

So, if we keep the same timing as in the first example but adapt our graphic according to the way the buffered mode is working, here is the result:

Because the movie clock is genlocked to the monitor and because the software always have minimum one frame in advance, the movie plays with a perfect regularity and timing : 1 1 2 2 3 3 4 4 … each frame is played exactly twice.

Why is it so cool?

If you are still not too sure why it’s nice to be genlocked at 60 fps here is a real time recording of the output from MediaMaster running 2 layers (captured with Fraps). The lower layer with the speakers runs at 30 fps while the top layer is a pattern that runs at 60 fps, this one is part of our test loops, it’s a ramp that allows to see very easily if the system is perfectly genlocked.

Most importantly, when applying effects to your content these effects will be rendered at 60 fps so with a perfect synchronization, your eyes will have the feeling that everything is crisp and fluid.

In order to see the videos in this article you need to have QuickTime installed. Of course, ensure your monitor frequency is set to 60 fps and the video below should play perfectly smooth. It’s an original screen capture of the MediaMaster output in 60 fps, it has just been resized to fit in this article.

Now in order for you to be able to see the difference here is the same loop at 30 fps:
> video no longer available...

Let’s continue to lower down the fps, here’s the 20 fps version:
> video no longer available...

And finally the 15 fps version:
> video no longer available...

Try for yourself!

If you are curious, you can test this for yourself, don’t hesitate to stress MediaMaster 1.1 when it’s out but also why not compare and test with any other software video mixer.. For your convenience, you can download our 60 fps test loops as QuickTime movie files further below.

For best results you should let them loop for a while. In a VJ application you can simply add them as the latest layer of your composition with an addition blending and you will see if your system is powerful enough and your software correctly coded.

You can download MediaMaster from our web site.

Back to All posts