Announcement

Collapse
No announcement yet.

FRC, the ultimate tearfree video solution

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • FRC, the ultimate tearfree video solution

    Hello to you all who are interested in high quality video playback on Linux! There is one very interesting project in development that allows perfect redraw synchronization when using AMD and Intel graphics hardware. I'm postin here to draw more attention to the project _and_ to make sure AMD hardware is not left behind. Main developer seems to work on Intel at the moment. Technical details follow.

    Many of you probably know what causes tearing and unsmooth video playback, but I'm going to explain a bit anyway. The very problem is different screen refresh and video frame/field frequency and the problem that frame rate resampling is anything but simple or perfect. Current solutions are just to ignore it (by dropping or doubling frames) or do the resampling (NVidia Purevideo). The resampling works well if the source is already motion compressed, so motion vectors can be used for constructing frames at arbitrary times. For really high fidelity stuff the workload is very high as motion serach has to be done, just like mpeg compression, but in realtime. Even still, the quality suffers. More processing -> more errors.

    Almost all of the above is unnecessary if screen and frame rates are the same. Television does just that. On PC hardware things get a bit tricky as apparently, is wasn't designed with such usage in mind. The project FRC or Frame Rate Control does those tricks purely in software and that makes it qute special. I've been trying to get some attention to the problem before and it may be of value to read a bit there too:

    http://www.botchco.com/agd5f/?p=15#comment-1004

    FRC, the _important_ part:

    http://frc.easy-vdr.de/

    For testing the concepts I suggest a clip of _interlaced_ DV-video with plenty of motion and camera stutter or dvb grab of animated news tickers. Before heading to the FRC it is good idea to play a bit with "cvt" and "xrandr" commands to get proper display modes. You'll need 50 Hz capable monitor for European dvb or digitized PAL. Also cvt rounds framerates somewhat weirdly, but specifying a bit more will get you closer. Like "cvt 1600 1200 50.05" will get 50.01 Hz out. The error would result field jitter every 50/(50.01-50)=5000 fields so once per 100 seconds. Normally that close tolerance is not achievable bacause of the cheap clock crystals and no adjustment. Kaffeine has good controls for deinterlacing, so make sure you are using _one_ frame deinterlacers like linear blend. Otherwise motion is blurred away.

    Last but not least I hope to see some developer comments here as this is definitely something to include to VA-API or some other video processing api specification. I remember Brigdman saying something like "frame locking is difficult to get working reliably" somewhere on phronix forums.

    Have fun!
    Last edited by vesa; 07-20-2009, 09:46 AM. Reason: typos.

  • #2
    Forgive my ignorance, but setting monitor refresh rate each time a movie is played is down right rude.

    Comment


    • #3
      I think the idea is that the monitor refresh rate is set automatically to precisely match the playback stream.

      As vesa says, this *is* the ultimate solution for high quality video as long as your display can work well at the stream's frame rate or a multiple of the frame rate. This gets real interesting when you combine it with a 120Hz display, which can run at an exact multiple of either 24 or 30 Hz frame rates.

      Comment


      • #4
        I agree with you on this. Fortunately it is not necessay every time. In case of the progressive 24 fps material 50 or 60 Hz will work quite well. Only real video hifists would like 48 or 72 Hz ... Also FRC does the adjustment without full crtc reset (unlike real mode change), so there is no blank period to be seen.

        Naturally it all boils down what's the purpose of the machine. I'm running my desktop at 50 Hz all the time because most of the material I work with is digitized PAL or 50 Hz DVB. Also I save a bit of memory bandwidth by using lower refresh. That's on itegrated display controller Q965 and the mb has very nice property of being fully synchroronous with all system clocks (video, audio, I/O...) phaselocked to main crystal reference. (Intel application notes are interesting, btw.) The only grief is bad power bypassing to ALC260 audio chip maybe I'll fix it someday...

        Even though FRC seems to be very SCART centric, it is really just one use of it.

        Xtiming script gives better flexibility than cvt as it allows one to tweak sync times too. That way it is possible to get even frequencies without rounding errors. DVI connected LCD seem very tolerant to adjustments.

        http://xtiming.sourceforge.net/cgi-bin/xtiming.pl

        Some forgotten links follow:

        http://www.kingcot.eclipse.co.uk/uni...tvoutTest.html

        The real test for deinterlacing. Remember that vsync works often only in full screen or in big window. Don't kow the reason though. Kaffeine with ScalerBob is the closest imitation of crt tv and
        mplayer -vf yadif=1:1 -fs will get somewhat processed, but very good result.

        http://www.linuxtv.org/wiki/index.ph..._Sync_Aliasing

        Comment


        • #5
          Originally posted by bridgman View Post
          This gets real interesting when you combine it with a 120Hz display, which can run at an exact multiple of either 24 or 30 Hz frame rates.
          Not to mention that one needs 300 Hz to be really universal. For 24, 25, 50, 60, 100 Hz

          Comment


          • #6
            Is there much use of frame rates over 30 ? My understanding was that 24, 25 and 30 pretty much covered all of the currently available DVD and BD disks (assuming 50i and 60i are displayed as 25p and 30p respectively). I know other formats are supported but AFAIK they aren't actually used much...

            Comment


            • #7
              Originally posted by bridgman View Post
              Is there much use of frame rates over 30 ? My understanding was that 24, 25 and 30 pretty much covered all of the currently available DVD and BD disks (assuming 50i and 60i are displayed as 25p and 30p respectively). I know other formats are supported but AFAIK they aren't actually used much...
              That's the gist of the problem. 50i and 60i _must_ be displayed as 50p and 60p on progressive displays to preserve the temporal resolution (fluid movement). I'm still subject to precensoring with links, so my 'official reply' is in the buffer... I'm delighted to see you here though. Any chances to push those patches forward? The author has had very much difficulties to get any discussion going on the relevant lists.

              Comment


              • #8
                I thought tearing was typically caused by mid-frame display updates; i.e. a phase problem rather than a frequency problem. Is that not the case?

                Comment


                • #9
                  Yes it is. You fix tearing by synchronizing frame buffer updates with the display refresh rate, however that introduces a *new* set of artifacts since the display refresh rate is not quite the same as the frame rate in the video stream. Tear-free code ends up occasionally skipping or doubling frames, depending on whether the video stream frame rate is higher or lower than the display refresh rate, which results in some jitter.

                  As with tearing, some people can see this jitter while others can not, which results in some interesting threads on the A/V forums.

                  The way you deal with the skipping/doubling jitter that comes with regular tear-free code is by synchronizing the display refresh rate to the video stream rather than skipping/doubling frames to synchronize the video stream to the display.

                  Make sense ?
                  Last edited by bridgman; 07-20-2009, 11:26 AM.

                  Comment


                  • #10
                    That's what I thought, but I was a bit confused by the claim of this being "the ultimate tearfree video solution" when it only seems to solve the frame doubling/skipping artifacts. Do those also show up as "tearing" somehow?

                    Comment


                    • #11
                      Originally posted by Ex-Cyber View Post
                      That's what I thought, but I was a bit confused by the claim of this being "the ultimate tearfree video solution" when it only seems to solve the frame doubling/skipping artifacts. Do those also show up as "tearing" somehow?
                      You know phase and frequency are quite convolved Mathematicians will entertain you ad nauseam... Simply put phase error will result from frequency error. The relative phase also 'slips' depending on the freq error.

                      When you get rid of the freq and phase error there is nothing to tear apart. Everything is smooth as butter. That includes no visual tricks whatsoever and is also provable to be 'perfect'.
                      Last edited by vesa; 07-20-2009, 11:45 AM.

                      Comment


                      • #12
                        Originally posted by Ex-Cyber View Post
                        That's what I thought, but I was a bit confused by the claim of this being "the ultimate tearfree video solution" when it only seems to solve the frame doubling/skipping artifacts. Do those also show up as "tearing" somehow?
                        Think of "ultimate tear-free" as meaning "tear-free without the side-effects", not "even more tear-free"

                        Comment


                        • #13
                          Originally posted by vesa View Post
                          You'll need 50 Hz capable monitor for European dvb
                          Cool sounding project - I've been looking into getting a decent lcd monitor for some time, but none of the specs I've seen go down to 50Hz.

                          Have you found that it is possible to underclock LCDs?

                          Comment


                          • #14
                            Originally posted by legume View Post
                            Cool sounding project - I've been looking into getting a decent lcd monitor for some time, but none of the specs I've seen go down to 50Hz.

                            Have you found that it is possible to underclock LCDs?
                            I think the some V(YXZ)GA spec starts officially from 56 Hz. It is easy to test and makes no damage in modern monitors. I've also noticed that some panel sizes don't usually support 50 Hz. Benq had in their P-series a monitor that started from 24 Hz. I guess every 'pro' stuff starts from 24 Hz. http://www.benq.com/products/LCD/?pr...specifications at least says 50 Hz. I'm no way affiliated with Benq and currently run ViewSonic VP171s (that I specifically bought because of 50 Hz and paid some premium back then) and LG L1950S. LG only does down to 60 Hz, but WS 48 Hz too, so kind of underclocking, but that much tolerance should be there anyway.

                            48, 50 and 60 Hz would be everything I need.

                            Comment


                            • #15
                              The ideal tear-free solution is a CRT monitor that supports run at 120Hz. 24p, 30p, 60i and 60p display perfectly, without touching timings or changing modes. You still have to drop to 100Hz for 25/50p, but such material is rare so it's not a problem.

                              That said, almost everyone has switched to TFTs nowadays which tend to lock at 60Hz. A few can do 72Hz or 48Hz, but that's relatively rare (plus you have to add custom timings because these modes are (usually) not reported automatically.

                              Bottom line: for perfect video, grab a CRT while you still can, or connect to an external TV that supports 24p-60p natively.

                              Comment

                              Working...
                              X