VideoHelp Forum
+ Reply to Thread
Results 1 to 25 of 25

Thread: Deinterlacing

Thread
  1. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    So I have been playing around with various deinterlacing strategies. Let me just say that I have a strong bias against interlaced material. 24p, 30p, you had me at 60p, are all I am really interested in. However, I am forced to work with interlaced material because I assemble video from various sources and trying to explain interlaced vs progressive to the non-interested is not constructive.

    I have tried yadif in ffmpeg. Seems reasonable. But I recently tried QTGMC in avisynth. The wiki on that plug-in is amusing. It says it is very demanding on your system. Well, I had an AVCHD 1920x1080i30 that was 10 minutes long. Using my i5 2500K, nearly 2 hours later it was done using the "Slow" setting. All in all I think it did a good job. If I was at my computer I would post some frames for comparison. Maybe later. I am sure I can speed this up with the multi-thread version. But I was unsuccessful in getting it to work. I will tweak with the MT settings some more.

    But one of the things I noticed is that QTGMC is almost infinitely configurable. So I was wondering if anyone here has experience with this plug-in. In particular settings that work well for you. IOW I am certain that I am not getting the most out of this plug-in.

    Let's generate some discussion shall we?
    Quote Quote  
  2. I almost always use the "fast" preset with 1080i. That gives about 15 frames per second (with no other processing) on my i5 2500K with multithreaded AviSynth.
    Quote Quote  
  3. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    Fast preset. That is interesting. Is that because you don't see any improvement using the Slow or some other setting?
    Quote Quote  
  4. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    There is visible improvement using "slower" in most cases - if you go frame by frame & zoom in, but there is something called "diminishing returns". You get ~95% of the quality using "fast" or "faster". (I use "faster" typically for most general use scenarios). There were comparisons posted before, and you can do your own tests to see what works for your particular scenario
    Quote Quote  
  5. In most cases you see very little improvement when using slow vs. fast -- both are far better than Yadif. With standard definition material you may want to use something better than fast because that SD frame will (most likely) be enlarged to full screen when you play it -- making any defects more obvious. But with a 1080i frame those defect will be small and hardly visible.

    By the way, adding in encoding with x264 at its slow preset reduces the throughput to ~7 fps in the above scenario.
    Last edited by jagabo; 12th Aug 2014 at 10:10.
    Quote Quote  
  6. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    ^^ You are absolutely correct that I need to do my own tests. Do you have any experience with some of the other settings like motion analysis, interpolation, or sharpness, etc? http://avisynth.nl/index.php/QTGMC has some of the best and most thorough documentation I have seen for any of these free tools. One of the multiple reasons I am drawn to it. I was just hoping someone might have something along the lines of "I always use sharpen because..." When I look through the list there are many rabbit holes but I am sure some are essential.
    Last edited by SameSelf; 12th Aug 2014 at 10:09. Reason: Make reply to whom clear
    Quote Quote  
  7. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    I almost always turn down the sharpen strength in QTGMC, because I feel the default setting of 1.0 is too high. When combined with the default denoising/temporal smoothing, it gives too much of a "plastic doll" look, especially on clean sources. But on some sources, default strenght might be ok

    For me, most of the preset values work fine. But on some sources (esp. analog sources) there are differences between the border regions compared to the original TGMC, for those I usually set border=true

    For HD sources, QTGMC in MT mode may crash because of memory. Using SetMemoryMax(1024) or (768) may reduce the incidences of crashing
    Quote Quote  
  8. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    Awesome advice thanks. This has given me a path forward on how to quickly evaluate optimal QTGMC settings. It will probably be a couple of days but my plan is to post back here with some frame grabs that illustrate my results.
    Quote Quote  
  9. And with film based sources an inverse telecine usually more appropriate than QTGMC.
    Quote Quote  
  10. I pretty much use the default settings 99% of the time.
    The most disappointing aspect of QTGMC is the eventual discovery it's progressive mode fixes almost everything, and then it starts to become hard to encode any video without it.

    For progressive video which could use some "stabilising" and noise removal QTGMC does a great job. I use it in progressive mode far more than I use it for de-interlacing these days.

    QTGMC(InputType=1, EzDenoise=2)

    I gave up on MT Avisynth. My QTGMC speed workaround is to make a copy of a script, add Trim() to the end of each so each one encodes around half the video, then I run both encodes at the same time. That tends to keep the CPU pretty busy. Just make sure to use --stitchable in the x264 command line so you won't have any problem appending the encodes together later.

    When I initially started playing around with QTGMC and progressive video, I uploaded some small torture test comparison encodes here.
    Quote Quote  
  11. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    Originally Posted by hello_hello View Post
    I gave up on MT Avisynth. My QTGMC speed workaround is to make a copy of a script, add Trim() to the end of each so each one encodes around half the video, then I run both encodes at the same time. That tends to keep the CPU pretty busy. Just make sure to use --stitchable in the x264 command line so you won't have any problem appending the encodes together later.
    Brilliant solution! I think I will use that technique as well. Thanks for the link to your old thread.
    Quote Quote  
  12. Member
    Join Date: May 2014
    Location: Tennessee, US
    Search Comp PM
    Originally Posted by jagabo View Post
    And with film based sources an inverse telecine usually more appropriate than QTGMC.
    You'd cringe if you knew how many ignore this statement.

    DO NOT DEINTERLACE telecined material. Use TIVTC.

    If your goal includes BluRay for standard BD-R disc, you should see this page: http://forum.doom9.org/showthread.php?t=154533.
    - My sister Ann's brother
    Quote Quote  
  13. Originally Posted by LMotlow View Post
    Originally Posted by jagabo View Post
    And with film based sources an inverse telecine usually more appropriate than QTGMC.
    You'd cringe if you knew how many ignore this statement.

    DO NOT DEINTERLACE telecined material. Use TIVTC.
    Or sometimes..... I use IVTC followed by QTGMC in progressive mode.
    Quote Quote  
  14. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    I am not worried about telecined content. All of my video is either shot by myself or another as opposed to 24p content acquired from 60 Hz sources.
    Quote Quote  
  15. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    I am back to post some comparisons. The video I am working with is AVCHD 1920x1080i30 that I am trying to convert to 30p. I have chosen a frame grab during a portion of the video where the camera is panning while the subjects are are perfectly still although the drum major is moving his arms. The frame grabs are roughly 640x480 crops/zooms.

    1. First frame grab is a simple weave using ffmpeg conversion to ProRes $ffmpeg -i input -vcodec prores -r 30000/1001 -an output.mov

    Name:  Weave_crop.jpg
Views: 84
Size:  83.9 KB

    2. The second image is using yadif in ffmpeg $ffmpeg -i input -vcodec prores -r 30000/1001 -vf yadif -an output.mov

    Name:  yadif_crop.jpg
Views: 80
Size:  71.4 KB

    3. The last image is using QTGMC with avisynth with a Slow setting to an AVI bitmap format

    Name:  QTGMC_crop.jpg
Views: 82
Size:  77.3 KB

    As can be seen, the need for deinterlace is crucial from just a single frame grab since this video is a marching band on a football field (similar to green screen but with vertical yard lines). It becomes painfully obvious that the viewer is watching interlaced material. But as shown in frame 2, yadif's simple bob plus whatever else it might be doing results in a fairly blurry image. I have to say that I am pretty impressed with the QTGMC example as the image is considerably sharper.

    Now I just need to figure out how to speed up QTGMC on my computer and play with some of the settings more. Hopefully I will be back to post some more comparisons.

    Also, I am running avisynth through Virtualdubmod and just doing a Save As in Virtualdubmod where it saves the avisynth output as an AVI. Does anyone have a better way of doing this?

    Thanks again for all the helpful feedback.
    Quote Quote  
  16. Originally Posted by SameSelf View Post
    As can be seen, the need for deinterlace is crucial...
    Depends on the player. DVD, for example, and BluRays, will be deinterlaced by the player or TV set. But I wouldn't call it 'crucial', in the sense that you think it necessary to deinterlace when reencoding, unless maybe you're uploading to YouTube or using a non-deinterlacing player for some reason.
    Quote Quote  
  17. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by SameSelf View Post

    As can be seen, the need for deinterlace is crucial from just a single frame grab since this video is a marching band on a football field (similar to green screen but with vertical yard lines). It becomes painfully obvious that the viewer is watching interlaced material. But as shown in frame 2, yadif's simple bob plus whatever else it might be doing results in a fairly blurry image. I have to say that I am pretty impressed with the QTGMC example as the image is considerably sharper
    It's not just "fairly blurry image" for yadif . You're looking at still images. In motion you will see "marching ants" artifacts, sort of buzzing or flickering along lines . The biggest strength of QTGMC IMO is the temporal smoothness, almost as if it were shot progressive in the first place without the flickery deinterlacing artifacts. In fact that's why it'd predecessor, TGMC was written in the first place - to reduce "bob flicker"


    Also, I am running avisynth through Virtualdubmod and just doing a Save As in Virtualdubmod where it saves the avisynth output as an AVI. Does anyone have a better way of doing this?

    I would recommend using vdub instead of vdubmod if you are wanting an AVI. But ffmpeg can accept avs scripts directly if avisynth support has been compiled. That gives you more options - so it really depends on why you are doing this / what scenarios / what your desired output goal(s) are

    There are some scenarios where you might want to leave them interlaced. For example, if you are producing for broadcast, or blu-ray.
    Quote Quote  
  18. Originally Posted by SameSelf View Post
    I have to say that I am pretty impressed with the QTGMC example as the image is considerably sharper.
    .
    .
    Hopefully I will be back to post some more comparisons.
    This has already been done. I applaud you doing it for yourself so you can come to your own conclusions, but no one needs to see more evidence of what they already know to be true.
    Quote Quote  
  19. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    My main goal for deinterlacing is this video will eventually find its way onto youtube. So rather than rely on youtube to deinterlace, I prefer to do my own thereby ensuring the best quality. As for Blu-ray, aren't all players progressive format anyway? With modern HDTVs the need for interlace support seems just quaint.
    Quote Quote  
  20. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Yes, as manono says - it's been compared many many times

    If you want to see one of the earliest comparisons (5-6 years ago) in motion, you can download this video, it compares yadif, TGMC (the original) with a couple others
    http://forum.videohelp.com/images/guides/p1934885/stockholma_0-520_q3_yadif_mvbobmod_t...mca4_tdtmm.avi

    I think everyone aggres it's the best overall in most situations. However, there are a few isolated scenarios where other deinterlacers actually work better


    As for Blu-ray, aren't all players progressive format anyway? With modern HDTVs the need for interlace support seems just quaint.
    Yes and no. For blu-ray, 1080p59.94 isn't supported , but 1080p24 and 720p59.94 (native progressive) are supported

    So you can't get the smoothness at 59.94 and and 1920x1080, without using interlace

    Believe it or not, interlace is still a big part of broadcast. ughhh.
    Quote Quote  
  21. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Believe it or not, interlace is still a big part of broadcast. ughhh.
    Yes, but with the growth of 4K video, I think it won't be long before interlace is gone and 60p or higher will become the defacto standard which is why I am trying to convert now all my interlaced video to avoid that "quaint" dated look it will surely have in a few years.
    Quote Quote  
  22. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by SameSelf View Post
    Originally Posted by poisondeathray View Post
    Believe it or not, interlace is still a big part of broadcast. ughhh.
    Yes, but with the growth of 4K video, I think it won't be long before interlace is gone and 60p or higher will become the defacto standard which is why I am trying to convert now all my interlaced video to avoid that "quaint" dated look it will surely have in a few years.

    I sincerely hope so, but I'll believe it when I see it.

    I think "won't be long" will end up being longer that what everyone wants. Hundreds of billions in infrastracture investments doesn't go "poof" very easily . People made the same sorts of proclamations when progressive flat panels and HDTV ATSC broadcasts standards were being discussed.

    And another reason you might not want to deinterlace (or at least archive the originals) is there might be better deinteralacing algorithms in the future
    Quote Quote  
  23. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    Originally Posted by poisondeathray View Post
    I would recommend using vdub instead of vdubmod if you are wanting an AVI. But ffmpeg can accept avs scripts directly if avisynth support has been compiled. That gives you more options - so it really depends on why you are doing this / what scenarios / what your desired output goal(s) are.
    Awesome! I was hating the fact I had to go through some player like vdub to run my avs script. I am not really interested in AVI. What I really want is a ProRes DI and it looks like running my avs script through ffmpeg is the way to go.

    Do I have to do something special with ffmpeg to get avisynth compiled? I am using ffmpeg on a win7 machine and just downloaded the latest version. Nothing else IIRC.
    Quote Quote  
  24. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    The zeranoe versions have avisynth support compiled, and can output prores
    http://ffmpeg.zeranoe.com/
    Quote Quote  
  25. Member
    Join Date: Aug 2014
    Location: Texas
    Search Comp PM
    Thanks poisondeathray
    Quote Quote