VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. I am looking for some basic Avisynth+ scripts, utilizing QTGMC, to deinterlace certain (non telecined) .mkv DVD rips. Most of these are of the late 80's and 90's era, think "back to the future". Trying to get some ideas to play around with and learn; yet save time on the trial and error.

    Am currently using a basic "Fast" QTGMC preset and I'm definitely losing sharpness. There are just so many additional options that I dont know where to begin.


    Yes, I understand the difference between interlaced and telecined videos, and for the subject of this post, I'm asking about interlaced. And I would not be asking if these videos could play without interlacing artifacts on the local devices connected to my media server (.Onn player connected to TV for example).
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Are you talking about double-rate deinterlacing?

    Are your source files marked as interlaced in mediainfo?
    I've not had problems with such files in the Onn box
    Last edited by davexnet; 13th Feb 2025 at 13:29.
    Quote Quote  
  3. There are thousands of threads here about QTGMC. Just do a search. Or post a particular sample (the source, not deinteralced or re-encoded) that's giving you problems.
    Quote Quote  
  4. Here's a photo of my display playing on the Onn direct play through a gigiabit LAN of the .mkv ripped directly from the disk

    Image
    [Attachment 85458 - Click to enlarge]


    Format : Matroska
    Format version : Version 2
    File size : 4.27 GiB
    Duration : 1 h 54 min
    Overall bit rate mode : Variable
    Overall bit rate : 5 351 kb/s
    Frame rate : 29.970 FPS
    Encoded date : 2025-02-13 01:35:46 UTC
    Writing application : MakeMKV v1.17.9 win(x64-release)
    Writing library : libmakemkv v1.17.9 (1.3.10/1.5.2) win(x64-release)

    Video
    ID : 1
    ID in the original source medium : 224 (0xE0)
    Format : MPEG Video
    Format version : Version 2
    Format profile : Main@Main
    Format settings : CustomMatrix / BVOP
    Format settings, BVOP : Yes
    Format settings, Matrix : Custom
    Format settings, GOP : M=3, N=15
    Format settings, picture structure : Frame
    Codec ID : V_MPEG2
    Codec ID/Info : MPEG 1 or 2 Video
    Duration : 1 h 54 min
    Bit rate mode : Variable
    Bit rate : 5 154 kb/s
    Maximum bit rate : 9 641 kb/s
    Width : 720 pixels
    Height : 480 pixels
    Display aspect ratio : 4:3
    Frame rate mode : Constant
    Frame rate : 29.970 (30000/1001) FPS
    Standard : NTSC
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Top Field First
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 0.498
    Time code of first frame : 00:00:00:00
    Time code source : Group of pictures header
    GOP, Open/Closed : Open
    GOP, Open/Closed of first frame : Closed
    Stream size : 4.11 GiB (96%)
    Language : English
    Default : No
    Forced : No
    Original source medium : DVD-Video
    Quote Quote  
  5. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    What app on the Onn box is playing the video?
    For example, I stream video from my PC using Kodi, and Kodi has it's own deinterlace settings.

    Post a short video sample, something with steady movement
    Quote Quote  
  6. AssumeTFF() set?
    Quote Quote  
  7. It is playing through a plex app. I can look at the decoder, but I believe it's android based.

    TFF/BFF is all ok. I'm asking about a good basic deinterlacing script. I certainly understand the concern to not deinterlace at all, but that is something else i'm looking at.

    Yes, thousands of threads but I have yet to find a basic script. I mean, you look at all of the "similar threads" and theres nothing there. I've come up with the following on my own but dont quite have the hours to compare and contrast. Feels like i'm reinventing the wheel here that someone else probably already has a go-to script for most interlaced dvd's.

    deinterlaced=video_org_crop.AssumeTFF().QTGMC(pres et="fast", EdiThreads=3)
    deinterlaced=video_org_crop.AssumeTFF().QTGMC(Pres et="Medium", SourceMatch=2, TR2=2 )
    deinterlaced=video_org_crop.AssumeTFF().QTGMC(pres et="fast", SourceMatch=3, Lossless=2, MatchEnhance=0.75, EdiThreads=3)
    deinterlaced=video_org_crop.AssumeTFF().QTGMC(pres et="slow", matchpreset="slow", matchpreset2="slow", sourcematch=3, tr1=2, tr2=1, NoiseTR=2, sharpness=0.1)
    Last edited by jeby1980; 13th Feb 2025 at 16:50.
    Quote Quote  
  8. Something like this is sufficient for most videos:
    Code:
    LWlibavVideoSource("filename.mkv")
    QTGMC()
    Be sure not to resize before deinterlacing. If you crop before deinterlacing be sure to crop by even values on the vertical axis. Otherwise you will reverse the field order. Some source filters don't handle MPEG 2 video in MKV properly. And loss of sharpness isn't the usual complaint about QTGMC -- too much sharpening is. Post your entire script.

    Thin horizontal lines are sometimes confused with interlacing and blurred (or moire) by QTGMC. Lossless mode can sometimes prevent that. But you get less effective deinterlacing elsewhere -- typically seen buzzing edges.



    There's no way Back to the Future was shot as interlaced video. Maybe you have a PAL/NTSC conversion?
    Last edited by jagabo; 13th Feb 2025 at 17:48.
    Quote Quote  
  9. SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)

    video_org=FFmpegSource2("xxxxxxxxx.mkv", atrack=-1)

    deinterlaced=video_org.AssumeTFF().QTGMC(preset="f ast", EdiThreads=3)

    return(deinterlaced)
    prefetch(10)
    Quote Quote  
  10. path = "K:\Videos\"
    filename = "YourFilename.avi"
    # Spline and Lanzcos are the best resizers (and avoid bilinear)
    # Spline 64 or Lanzcos best for upscaling
    # bicubic for downscaling
    # SetFilterMTMode("QTGMC", 2)
    FFmpegSource2( path + filename , atrack = 1)
    ConvertToYV12(interlaced = true)
    # AssumeBFF()
    # FPSDivisor 1=double rate; 2=single rate
    QTGMC(Preset="Slower", Edithreads=4)
    # Crop(0 , 0 , -2 , -2)
    # BicubicResize (640,480)
    # LanczosResize(720,540,taps=4)
    # BilinearResize(640,480)
    Spline64Resize(720,540)
    # Prefetch()
    # Trim(0, 3597) # 1 minute @59.94 fps
    # Version()
    Quote Quote  
  11. Nice, thanks.

    As an aside, when you run this in virtualdub, what do you usually set the video compression as? Leave it (Uncompressed RGB/YCbCr) and then encode it in handbrake with h.264/h.265 perhaps?
    Quote Quote  
  12. Yes ... VirtualDub2_v2.2 works extremely well for this. Or you can simply specify the avs script using ffmpeg in command line mode within a .BAT file, which is what I do.

    For example
    REM SVT-AV1 for 60 second clip.
    ffmpeg -i Filename.avs -t 00:01:00 -c:v libsvtav1 -preset 4 -crf 21 -c:a libopus -b:a 192k Filename.mkv
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!