VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker or buy PlayOn and record Netflix! :)
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. Hello.

    I have the best show in the world, Invader Zim, as a DVD box-set. Since I am not happy with the results of real-time deinterlacing of the DVD playback in MPC-HC and VLC, or on my TV from my PC through HDMI, I wanted to try my hand with encoding it all to the finest possible quality, deinterlaced, to put in my media library. This is also because the DVD box-set is shaped like a small house, and I'm afraid it'll break if I keep opening it.

    I tried Handbrake. Did not get good results. You can see the test videos and my description of the results, in the Google Drive folder linked further down.
    From these tests, I learned that I probably need to detelecine, in order to get the smoothest playback.

    Then I read up on it quite a lot, and found a lot of helpful posts. But as I read on, I understood that the solution is often very specific to each DVD, due to encoding settings, NTSC/PAL, etc..

    These readings led me to a program called MeGUI (v. 2808), which basically tries to wrap the usage of AviSynth. After tinkering a lot with it, and trying different settings, I'm just not happy with anything I can make it spit out. See the Google Drive folder linked further down, to see what I mean.

    I've installed quite a few plugins, such as QTGMC and SRestore, as mentioned in this post. They do produce MUCH better results when it comes to deinterlacing/decombing, but I just can't get smooth playback at the same time.

    I am really hoping some of you can help me. I have tried to supply you with all the information usually requested in threads like these.


    General DVD information:
    NTSC
    Interlaced
    Top Field First
    29.970 (30000/1001) fps


    Wishes:
    PAL output
    23.976 (24000/1001) fps OR WHATEVER IS RIGHT FOR PAL (not sure if this is needed, really. My computer screen is running 60Hz and my TV is running 200Hz, but I live in Europe where PAL is the standard, and 29.970 fps videos do not play smoothly on my TV).
    I am not against frame doubling, if that helps. As long as my players will be able to play it back.


    Link to Google Drive folder, which holds:
    - a short sample of the original .VOB.
    - a Mediainfo output for the original file, and also one for the sample.
    - all the test sample videos, each with the AviSynth script and a description of the result, in a text file next to them.


    Will I need to use pulldown? I've read that some NTSC DVDs need that.

    Any help is GREATLY appreciated!


    Sincerely, Ultroman the Tacoman
    Last edited by Ultroman; 10th Feb 2018 at 19:04.
    Quote Quote  
  2. I spent some time on the series a few years ago. It's pretty tough because it's hard telecined, and it was edited and tuned (shots sped up or slowed, and hence mixed frame rates) as interlaced video. For decent results you'll need to learn AviSynth.
    Image Attached Files
    Quote Quote  
  3. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Will 24 fps work on your TV withoput stuttering?
    I used DGindex manually to create a d2v file and demux ac3 audio. (honor pulldown flags set)
    and the following script, encoded in Ripbit264.
    For a quick and dirty demo, I re-encoded the audio probably not necessary, you can mux it in after.

    Code:
    LoadPlugin("f:\yourpath\DGDecode.dll")
    LoadCPlugin("f:\yourpath\ffms2.dll")
    import("F:\yourpath\srestore.avs")
    Load_Stdcall_plugin("f:\yourpath\yadif.dll")
    Audio = directshowsource("F:\yourpath\SAMPLE T80 2_0ch 192Kbps DELAY -59ms.ac3",video=no)
    video=mpeg2source("F:\yourpath\SAMPLE.d2v")
    video=video.assumetff().yadif(mode=1)
    video=video.SRestore(24)
    Audio = Audio.DelayAudio(-0.059)
    audiodub(video,audio)
    #AssumeFPS(25, sync_audio=true).ResampleAudio(48000)
    Edit -Jagabo's HD version is better
    Image Attached Files
    Quote Quote  
  4. Originally Posted by jagabo View Post
    I spent some time on the series a few years ago. It's pretty tough because it's hard telecined, and it was edited and tuned (shots sped up or slowed, and hence mixed frame rates) as interlaced video. For decent results you'll need to learn AviSynth.
    Thanks a lot for your feedback. I do appreciate that it is an art form to get this right. From what you're saying about the tuned sequences, it sounds like it'll be near impossible. That said, your sample looks drop dead gorgeous, and runs very well on my various players. That's just the intro, though. From what you're saying, it would probably vary throughout the actual episodes.

    I would really appreciate any pointers, if you remember anything about your experience with the series. Is there anything in particular I should look at, when diving into AviSynth? Or is it "just" trudging through tutorials and playing around?


    Originally Posted by davexnet View Post
    Will 24 fps work on your TV withoput stuttering?
    It's very close, but not quite. jagabo's looks much more smooth, but then it's a 60 fps sample, so of course it does.
    Nonetheless, I thank you very much for your time and effort!
    Quote Quote  
  5. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    As I expected. The last line of the script I commented out. If uncommented it will increase the fps to 25 and adjust the audio
    to compensate,
    But jagabo's result is more sophisticated and leaves the audio as-is
    Good luck
    Quote Quote  
  6. Member
    Join Date
    Aug 2017
    Location
    United States
    Search PM
    Originally Posted by jagabo View Post
    I spent some time on the series a few years ago. It's pretty tough because it's hard telecined, and it was edited and tuned (shots sped up or slowed, and hence mixed frame rates) as interlaced video. For decent results you'll need to learn AviSynth.
    I frequently run into the chroma upsampling bug with these interlaced sources. Did you actively compensate for that in this clip?
    Quote Quote  
  7. Originally Posted by Ultroman View Post
    I would really appreciate any pointers, if you remember anything about your experience with the series. Is there anything in particular I should look at, when diving into AviSynth? Or is it "just" trudging through tutorials and playing around?
    The clip you provided doesn't have any of the more difficult problems so can pretty easily be restored to the original film frames. Here's a simple script to start with:

    Code:
    Mpeg2Source("SAMPLE.d2v", CPU2="xxxxxx", Info=3)  # deblocking and deringing filters activated
    Interleave(TFM(field=1, pp=0), TFM(field=0, pp=0)) # double frame rate field matching to 59.94 fps
    vInverse() # eliminate some horizontal line artifacts
    # stop here for 60p
    #TDecimate(mode=2, rate=23.976) # back to 23.976 fps film frames
    # stop here for 24p
    #AssumeFPS(25) # speed up to 25 fps
    Attached are 59.94, 25 and 23.976 fps encodings (no audio). Do you see much difference in smoothness when watched on your PAL TV?

    I went with 60p partly because I live in the USA and all TVs are now 60p, and because some of the problems in the source left jerky shots when reduced to 24p. Using 60p meant that the encoded video wouldn't be any jerkier than the original DVD (especially during those odd cadence shots). I used interleaved TFMs as my base clip and substituted problematic frames with frames from other methods of deinterlacing and sometimes replacing individual bad frames with the frame before or the frame after. Each episode took many hours because I had to examine the video frame by frame. I used a few other filters to clean the video and upscale it. Here's a sample script:

    Code:
    Mpeg2Source("Invader Zim E2.d2v", CPU=6, Info=3) # deblocking and deringing
    AssumeTFF()
    
    qtg=QTGMC(preset="fast", sharpness=0.7)
    qtge=SelectEven(qtg)
    qtgo=SelectOdd(qtg)
    clean=Interleave(TFM(field=1,mode=1,pp=1),TFM(field=0,mode=1,pp=1))
    deint=Interleave(TFM(field=1,mode=1,pp=5,cthresh=0,clip2=qtge),TFM(field=0,mode=1,pp=5,cthresh=0,clip2=qtgo))
    Interleave(TFM(field=1,mode=1,pp=5,cthresh=12,clip2=qtge),TFM(field=0,mode=1,pp=5,cthresh=12,clip2=qtgo))
    
    ReplaceFramesSimple(last, clean, Mappings="[44101 44393] [51312 51551]")
    ReplaceFramesSimple(last, deint, Mappings="[22238 22238] [22644 22644] [23423 23423] [26557 26557]")
    ReplaceFramesSimple(last, deint, Mappings="[26744 26744] [27323 27323] [27375 27375] [27390 27390]")
    ReplaceFramesSimple(last, deint, Mappings="[33505 33505]")
    ReplaceFramePrev(34115)
    ReplaceFramePrev(34141)
    ReplaceFrameNext(34156)
    ReplaceFrameNext(34209)
    ReplaceFramePrev(34894)
    ReplaceFrameNext(34921)
    ReplaceFrameNext(34947)
    ReplaceFramePrev(34962)
    ReplaceFramePrev(34973)
    ReplaceFramePrev(34988)
    ReplaceFramePrev(35001)
    ReplaceFrameNext(35014)
    ReplaceFrameNext(35027)
    ReplaceFramePrev(35042)
    ReplaceFrameNext(35053)
    ReplaceFramePrev(35068)
    ReplaceFramePrev(35094)
    ReplaceFramePrev(35112)
    ReplaceFramePrev(35138)
    ReplaceFrameNext(35165)
    ReplaceFramePrev(35206)
    ReplaceFrameNext(35217)
    ReplaceFrameNext(35232)
    ReplaceFrameNext(35245)
    ReplaceFrameNext(35258)
    ReplaceFrameNext(35271)
    ReplaceFramePrev(35286)
    ReplaceFramePrev(37062)
    ReplaceFrameNext(37063)
    ReplaceFramePrev(37088)
    ReplaceFrameNext(37089)
    ReplaceFramePrev(37093)
    ReplaceFrameNext(37094)
    ReplaceFrameNext(37098)
    ReplaceFrameNext(37097)
    ReplaceFramesSimple(last, deint, Mappings="[38884 38884] [38923 38923] [38964 38964]")
    ReplaceFramesSimple(last, deint, Mappings="[60554 60554]")
    
    UnDot()
    ColorMatrix(mode="Rec.601->Rec.709")
    MergeChroma(aWarpSharp2(depth=5),aWarpSharp2(depth=10))
    TTempSmooth(maxr=2,strength=2)
    FastLineDarken(thinning=0)
    
    nnedi3_rpow2(2,cshift="Spline64Resize", fwidth=960, fheight=720)
    Sharpen(0.2)
    FastLineDarken(thinning=0)
    Dehalo_alpha(rx=2.0, ry=2.0)
    
    nnedi3_rpow2(2,cshift="Spline64Resize", fwidth=1440, fheight=1080)
    Sharpen(0.2)
    Toon(0.5)
    Image Attached Files
    Quote Quote  
  8. Member
    Join Date
    Aug 2017
    Location
    United States
    Search PM
    That's some great stuff, jagabo. I'm kind of amazed at how good the upscaling looks using just nnedi3 and some sharpening.
    Quote Quote  
  9. Originally Posted by SaurusX View Post
    That's some great stuff, jagabo. I'm kind of amazed at how good the upscaling looks using just nnedi3 and some sharpening.
    A lot has to do with getting the video clean before upscaling. And it works better with cartoons rather than real world video.
    Quote Quote  
  10. Oh my GOD, jagabo. That's some dedication to a series right there! And a brilliant approach. From your naming and my albeit lacking understanding of the different filters and parameters, I get what you're doing.

    First, to answer your question, it seems that there isn't much difference in your three video files. The 24p one has a tiny bit of lag each second, but that's it.

    I spent all of yesterday playing around (still in MeGUI), and got to what I thought was just about acceptable, aside from a bunch of noise, which I just couldn't get rid of. I ended up with this:
    Code:
    mpeg2source("path\01 YG_VTS_02_1_1.d2v")
    tfm(d2v="path\01 YG_VTS_02_1_1.d2v")
    tdecimate(mode=1)
    Spline36Resize(656,480)
    Dehalo_alpha(darkstr=0.5,brightstr=0.5,rx=3,ry=3)
    Edgecleaner(strength=50)
    
    FFT3DFilter(bt=0, sigma=2.0, beta=1.35, kratio=1.5, wintype=1)
    ...the result of which is the quality and smoothness you see in the attached videos.

    But the FFT3DFilter seems to group noise, rather than wash it out, though it seems to wash out thin lines (e.g. on the grey space station), which is a shame, and also why I set the beta parameter to let 35% noise through, so it wouldn't be too evident.

    I also played for an hour or two with QTGMC, both with and without the deinterlacing part (after I found tfm and tdecimate, which seem to do a great job with that), but it seemed I could never get the right balance.

    I also didn't like the results of the default settings of Deen(), and I didn't have time to go into detail with it. I also tried TBilateral, which is really good, but not for this project I think.

    I'm going to try messing with the filters and process chain you've got going on in the larger script. You have been invaluable already. Thank you SO much for this!

    I hadn't even considered upscaling, either. I thought "why mess with the source more than I have to", but what you showed in the first upscaled clip looks jawdroppingly good.

    I also read up a lot on x264 encoding settings, and have been experimenting with those, as the initial results I was seeing, looked nothing like what I saw in MeGUI. It's pretty close now, but I must admit, some things might be turned up farther than they need to ^^

    I will return when I've played around with the settings you've posted. Thanks again! This was much more than I could have hoped for
    Image Attached Files
    Last edited by Ultroman; 12th Feb 2018 at 15:12.
    Quote Quote  
  11. Man, I am learning SO much doing this!

    I've been playing around with these AWESOME filters you've shown me, jagabo, and they have improved everything tremendously! I did tweak a bit, though. Most prominently, I disabled the luma deblocking on Mpeg2Source, because it just smudged the hell out of faint lines when the camera panned at slow to medium speed. More comments about changes in the script.

    Code:
    Mpeg2Source("path\01 YG_VTS_02_1_1.d2v", cpu2="ooxxxx") # No luma H/V deblocking (oo) / H/V chroma deblocking (xx) / luma and chroma deringing (xx)
    AssumeTFF()
    
    # Did tests using tfm/tdecimate, and tests with QTGMC.
    
    # tfm/tdecimate deinterlacing START
    #tfm(d2v="E:\Download\Invader Zim The Complete Box Set (2001-2003) DVD-9 NTSC Latino YG\DVD1 Rip\01 YG_VTS_02_1_1.d2v")
    #tdecimate(mode=1)
    # tfm/tdecimate deinterlacing END
    
    # QTGMC deinterlacing START
    qtg=QTGMC(preset="fast", sharpness=0.7)
    qtge=SelectEven(qtg)
    qtgo=SelectOdd(qtg)
    ##clean=Interleave(TFM(field=1,mode=1,pp=1),TFM(field=0,mode=1,pp=1))
    ##deint=Interleave(TFM(field=1,mode=1,pp=5,cthresh=0,clip2=qtge),TFM(field=0,mode=1,pp=5,cthresh=0,clip2=qtgo))
    Interleave(TFM(field=1,mode=1,pp=5,cthresh=12,clip2=qtge),TFM(field=0,mode=1,pp=5,cthresh=12,clip2=qtgo))
    # QTGMC deinterlacing END
    
    UnDot()
    ColorMatrix(mode="Rec.601->Rec.709")
    FFT3DFilter(bt=0, sigma=2.0, beta=1.3, kratio=1.5, wintype=1)   # kinda makes the noise stand still, so the image is less noisy
    MergeChroma(aWarpSharp2(depth=5),aWarpSharp2(depth=10))   # oh my God, where have you been all my life, MergeChroma?
    TTempSmooth(maxr=2,strength=2, LThresh=2, CThresh=5)
    Edgecleaner(strength=75)                                                           # removes some residual noise around edges, for a more cartooney feel
    FastLineDarkenMOD(thinning=0, strength=24)                              # kept the first line darkening (love this filter), but decreased strength to half, which is 24
    
    # UPSCALING START
    nnedi3_rpow2(2,cshift="Spline64Resize", fwidth=960, fheight=720)
    Sharpen(0.2)
    #FastLineDarkenMOD(thinning=0, strength=24)                             # disabled the last extra darkening of lines, since there is already plenty to my taste
    Dehalo_alpha(rx=2.0, ry=2.0)
    
    nnedi3_rpow2(2,cshift="Spline64Resize", fwidth=1440, fheight=1080)
    Sharpen(0.2)
    # UPSCALING END
    
    Toon(0.5)
    Look at these results! (the attached videos are done with tfm/tdecimate) Just a bit more tinkering, and of course testing with more problematic places.

    Here are the QTGMC 60 fps versions of the same two clips.
    Invader Zim sample (enhanced and upscaled and 60 fps)
    Invader Zim sample (enhanced and 60 fps)

    Do you have a strong argument why I should use QTGMC, aside from your frame replacement system, and the 60 fps output? Because for me, the 23.976 fps output runs pretty damn smooth. If it's just the two arguments I mentioned, then it's a toss-up for me. I might just do 60 fps (QTGMC) for the hell of it, so I don't have to ever go back to this
    Image Attached Files
    Quote Quote  
  12. Originally Posted by Ultroman View Post
    I disabled the luma deblocking on Mpeg2Source, because it just smudged the hell out of faint lines
    Yes, it does overdo it. You can try using deblock_qed() instead. It allows you to control the deblocking strength.

    Originally Posted by Ultroman View Post
    Do you have a strong argument why I should use QTGMC, aside from your frame replacement system, and the 60 fps output?
    You will run into shots where reducing the frame rate to 24 fps gives more obviously jerky results. QTGMC screws up some of the video too. There were a few episode with a lot of those simulated raster displays where QTGMC left severe moire artifacts. Even TFM() gave problems with those as it misidentified the raster lines as residual combing an deinterlaced it in post processing (hence the reduced post processing in the TFM calls).

    I did very minor noise reduction with UnDot and TTempSmooth. I rarely use any strong spacial noise reduction filters as I don't like the results.

    I didn't exactly analyze every frame when I did those conversions. I ran a partial script and watched as I held down the right arrow in VirtualDub (15 fps?). When I noticed a bad frame I went back to get the exact frame number and replaced it with another.
    Quote Quote  
  13. Here's an example of QTGMC screwing up on the simulated raster scan. The dual TVM screws up here and there because there are orphaned fields (fields for which there is no complimentary field to complete the original film frame) because the scene was sped up after being telecined. On some of those I went back and replaced the bad frames with a copy of the frame before or the frame after.
    Image Attached Files
    Quote Quote  
  14. Originally Posted by jagabo View Post
    Here's an example of QTGMC screwing up on the simulated raster scan. The dual TVM screws up here and there because there are orphaned fields (fields for which there is no complimentary field to complete the original film frame) because the scene was sped up after being telecined. On some of those I went back and replaced the bad frames with a copy of the frame before or the frame after.
    Wow, I see what you mean. I'll have to watch out for those. Though, it doesn't look like any of the frames are correct in your sample (on the right side, which I'm guessing is QTGMC), so how does it help to replace those frames with the frame before/after? Do you mean that you used the frames from the "clean" clip, which doesn't use QTGMC? Or the less processed ones from the "deint" clip? Even a few frames in the tfm-interleave (left side) mess up.

    I've also seen a few frames being very noisy, right after a camera view change, but those are also present in the source. I guess many of those can also be replaced with one of the following frames, if I'm lucky.

    I know I keep saying this, but I REALLY appreciate your insights and help. I feel like I'm on the fast-track here
    Quote Quote  
  15. Originally Posted by Ultroman View Post
    Originally Posted by jagabo View Post
    Here's an example of QTGMC screwing up on the simulated raster scan. The dual TVM screws up here and there because there are orphaned fields (fields for which there is no complimentary field to complete the original film frame) because the scene was sped up after being telecined. On some of those I went back and replaced the bad frames with a copy of the frame before or the frame after.
    Wow, I see what you mean. I'll have to watch out for those. Though, it doesn't look like any of the frames are correct in your sample (on the right side, which I'm guessing is QTGMC),
    The left side is Interleave(TFM(field=1,mode=1,pp=1),TFM(field=0,mo de=1,pp=1)). The right side is QTGMC().

    Originally Posted by Ultroman View Post
    so how does it help to replace those frames with the frame before/after?
    The before/after replacments were only used in places where there was a single bad frame -- usually from an orphaned field.

    Originally Posted by Ultroman View Post
    Do you mean that you used the frames from the "clean" clip, which doesn't use QTGMC? Or the less processed ones from the "deint" clip?
    Yes, for longer stretches I used one of the other clips.

    Originally Posted by Ultroman View Post
    Even a few frames in the tfm-interleave (left side) mess up.
    That was just a quick demonstration of the difference between interleaved TFM and QTGMC. In the real video I would have copied one of the adjacent frames over the bad frames.

    Originally Posted by Ultroman View Post
    I've also seen a few frames being very noisy, right after a camera view change, but those are also present in the source. I guess many of those can also be replaced with one of the following frames, if I'm lucky.
    Yes.
    Quote Quote  
  16. Thanks a lot for your time and your tools. I have my work cut out for me, but I feel like you've provided me with the right tools for the job. I really cannot thank you enough. Seeing my favorite show in such splendor, all but brings a tear to my eye.

    Is there any way I could maybe throw a donation your way?
    Quote Quote  
  17. Originally Posted by Ultroman View Post
    Thanks a lot for your time and your tools. I have my work cut out for me, but I feel like you've provided me with the right tools for the job. I really cannot thank you enough. Seeing my favorite show in such splendor, all but brings a tear to my eye.
    I'm glad I could help out.

    Originally Posted by Ultroman View Post
    Is there any way I could maybe throw a donation your way?
    Just help someone else some day.

    When I watched the first episode of Zim (DVD from the library) I had mixed feelings about the show. All the characters were annoying. But I decided to continue watching. It quickly grew on me and became one of my favorite shows! Most of the discs were stolen from the local libraries so I eventually bought the entire series. Too bad the show was so short lived.

    Oh, and I forgot that I never finished the 1080p upscaling. I originally did a less extensive upscale to 720p without all the hand patching. It looks like I need to update several more episodes.
    Quote Quote  



Similar Threads