VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors.
Consider supporting us by disable adblocker or buy Replay Video Capture or PlayON and record Netflix!
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    I've recently noticed that using QTGMC when the Srestore plugin has also been loaded causes certain "stationary" areas of certain shots to "bounce" instead of staying stationary. This seems to only happen when the shot itself is predominately stationary (no panning or zooming, and relatively little change in the frame itself), and even then, only sometimes. Otherwise, the majority of the video looks perfect (or at least, as perfect as it can look). Changing the QTGMC presets has no effect.

    Does anyone know how to keep the stationary parts of these shots from bouncing?

    My current script:
    Code:
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\masktools2.dll")
    Import("C:\Program Files (x86)\AviSynth\plugins\Srestore_27h.avsi")
    clip1 = MPEG2Source("C:\DVD\1\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\DVD\2\VTS_01_1.d2v")
    clip2.Trim(21,2716).FadeOut0(19) + clip1.Trim(2696,0)
    QTGMC( Preset="Placebo" )
    Srestore(Frate=23.976)
    Video source:
    It's encoded interlaced and has interlaced frames, and there's field blending.

    Software:
    VirtualDub-1.10.4
    AviSynth 2.6
    Srestore 2.7h
    Masktools2 2.2.14
    MVTools2 2.7.25 with-depans
    NNEDI3 0.9.4.48
    QTGMC 3.357
    RgTools 0.96
    SMDegrain 3.1.2.93s
    FFT3DFilter 2.4
    GRunT 1.0.1

    Specs:
    Windows 7 Professional, 64-bit
    AMD Phenom(tm) II X6 1090T Processor 3.21 GHz
    AMD 6870
    AMD 6850
    8.00 GB RAM
    Quote Quote  
  2. Member
    Join Date
    Aug 2017
    Location
    United States
    Search PM
    use some of the deshimmering settings in QTGMC. Like tr2=1 or tr=2 or 3 if it's really bad.
    Quote Quote  
  3. Maybe the wrong field order. Try AssumeTFF() or AssumeBFF() before QTGMC(). Or maybe SwapFields(). Or post a sample of the source.
    Quote Quote  
  4. Probably nothing to do with the problem, but wouldn't it be better to de-interlace and deblend the clips before combining them?

    clip1 = MPEG2Source("C:\DVD\1\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    clip2 = MPEG2Source("C:\DVD\2\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    clip2.Trim(21,2716).FadeOut0(19) + clip1.Trim(2696,0)

    Of course the frame numbers for trimming would change, but appending scripts can't mess with SRestore's deblending that way.
    Quote Quote  
  5. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    Maybe the wrong field order. Try AssumeTFF() or AssumeBFF() before QTGMC(). Or maybe SwapFields(). Or post a sample of the source.
    Thanks for those suggestions, but none of them made the issue better, and even more of the shot bounces with SwapFields(). Attached is a sample of the source.

    Originally Posted by hello_hello View Post
    Probably nothing to do with the problem, but wouldn't it be better to de-interlace and deblend the clips before combining them?

    clip1 = MPEG2Source("C:\DVD\1\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    clip2 = MPEG2Source("C:\DVD\2\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    clip2.Trim(21,2716).FadeOut0(19) + clip1.Trim(2696,0)

    Of course the frame numbers for trimming would change, but appending scripts can't mess with SRestore's deblending that way.
    Thanks! In what way might I notice Srestore's deblending being messed with? I only only combined the clips after QTGMC and Srestore because skipping around in the video to find the right spots for the cuts is a lot easier that way in VirtualDub. But I would much rather do things the proper way than the easy way.

    Originally Posted by SaurusX View Post
    use some of the deshimmering settings in QTGMC. Like tr2=1 or tr=2 or 3 if it's really bad.
    Thanks for the suggestion, but TR2=1 and TR2=2 have no effect in my case.
    Image Attached Files
    Quote Quote  
  6. All those thin horizontal lines are confusing QTGMC. And there's essentially no motion in the clip making it hard to really analyze. Can you provide a clip with some real motion? Or, if this is the only part you're having problems with there are other ways to deal with it.
    Quote Quote  
  7. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    All those thin horizontal lines are confusing QTGMC. And there's essentially no motion in the clip making it hard to really analyze. Can you provide a clip with some real motion?
    Yes, I can provide a clip with more motion, what kind of motion would be most helpful? A steady pan? If that's the case, it almost certainly won't be one of the shots that is giving me problems, which are all mostly still. Also, those thin lines are mimicking a monitor, so they're unique to that shot. But the problem I'm having does extend beyond that to shots without the lines.

    Originally Posted by jagabo View Post
    Or, if this is the only part you're having problems with there are other ways to deal with it.
    Unfortunately, this isn't the only part I'm having problems with. There are multiple DVDs I'm working with, each one with a handful of episodes. I haven't gone through and done a thorough check, but a cursory search indicates that there seems to be an average of one problem shot per episode. I suspect there are more though.
    Last edited by lomaidala; 13th May 2018 at 02:04.
    Quote Quote  
  8. Something with mixed motion would be best, moderate speed panning, character motion, etc.

    That particular shot will probably have to be special cased. Something like this works because the only thing that needs deinterlacing is the bright white text:

    Code:
    # build a mask of bright white areas, sum frame before, frame, and frame after
    mask = last.Trim(1,0).mt_binarize(180)
    mask = Overlay(mask, last.mt_binarize(180), mode="lighten")
    mask = Overlay(mask, last.loop(2,0,0).mt_binarize(180), mode="lighten")
    mask = mask.mt_expand().Blur(1.0).Blur(1.0).Blur(1.0) # expand and soften edges
    
    Overlay(last, Blur(0.0, 1.0), mask=mask) # vertical blur (cheap deinterlace) only the masked areas
    In the end, no deinterlacer is perfect, nor can there ever be one.
    Quote Quote  
  9. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    Something with mixed motion would be best, moderate speed panning, character motion, etc.
    Okay thanks, see attachment.

    Originally Posted by jagabo View Post
    That particular shot will probably have to be special cased. Something like this works because the only thing that needs deinterlacing is the bright white text:

    Code:
    # build a mask of bright white areas, sum frame before, frame, and frame after
    mask = last.Trim(1,0).mt_binarize(180)
    mask = Overlay(mask, last.mt_binarize(180), mode="lighten")
    mask = Overlay(mask, last.loop(2,0,0).mt_binarize(180), mode="lighten")
    mask = mask.mt_expand().Blur(1.0).Blur(1.0).Blur(1.0) # expand and soften edges
    
    Overlay(last, Blur(0.0, 1.0), mask=mask) # vertical blur (cheap deinterlace) only the masked areas
    Thank you. I tried integrating your code into my script, but I came up with this error:
    VirtualDub Error
    Avisynth open failure:
    Script error: Invalid arguments to function "Blur"
    (line 15)

    Current script:
    Code:
    LoadPlugin("C:\DVD\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\masktools2.dll")
    Import("C:\Program Files (x86)\AviSynth\plugins\Srestore_27h.avsi")
    clip1 = MPEG2Source("C:\DVD\1\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    clip2 = MPEG2Source("C:\DVD\2\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    mask = ImageSource("C:\Images\1.png")
    mask = mask.ConvertToRGB32
    mask = clip1.Trim(6665,7300).mt_binarize(180)
    mask = Overlay(mask, clip1.mt_binarize(180), mode="lighten")
    mask = Overlay(mask, clip1.loop(2,0,0).mt_binarize(180), mode="lighten")
    mask = mask.mt_expand().Blur(1.0).Blur(1.0).Blur(1.0)
    clip2.Trim(11,2178).FadeOut0(15) + \
    clip1.Trim(2169,6664) + \
    clip1.Trim(6665,7300).Overlay(clip1, Blur(0.0, 1.0), mask=mask) + \
    clip1.Trim(7301,0)
    I'm also thinking another approach might be better in this case because there's actually more of the shot you haven't seen (not included in my previous sample), which includes animation that covers the entire frame. Because of this, and because the unintentional interlacing won't look too out of place in this case because the original shot is meant to mimic a monitor with scan lines, do you think a better approach would be to just lose QTGMC altogether for just this one shot? Perhaps using RemapFrames?

    Originally Posted by jagabo View Post
    In the end, no deinterlacer is perfect, nor can there ever be one.
    Good to know. I'm definitely happier using a deinterlacer with its imperfections than I am leaving the video interlaced.
    Image Attached Files
    Last edited by lomaidala; 14th May 2018 at 09:57.
    Quote Quote  
  10. The problem with Blur() in your script is that you aren't specifying what video to blur. AviSynth uses the name "last" whenever you don't specify a clip for input and output. So a script like this:

    Code:
    Mpeg2Source("filename.d2v")
    Blur(1.0)
    really means:

    Code:
    last = Mpeg2Source("filename.d2v")
    last = Blur(last, 1.0)
    return(last)
    In your script, the line:

    Code:
    clip1.Trim(6665,7300).Overlay(clip1, Blur(0.0, 1.0), mask=mask)) + clip1.Trim(7301,0)
    Blur() is trying work on last but you have explicitly named all the streams prior to that so there is no clip named last. There also a problem with the use of cllip1.Trim() and Overlay(clip1...). clip1 in the Overlay function is not the clipped version, but the original version of clip1. I recommend you split that into something like (I think this is what you're trying to do):

    Code:
    special = clip1.Trim(6665,7300)
    special = Overlay(special, Blur(special, 0.0, 1.0), mask=mask)
    special + clip1.Trim(7301,0)
    There are other problems with your scirpt. You create a clip called mask from ImageSource() and convert it to RGB. Then you created a clip called mask (discarding the previous one) from clip1.Trim(...)... I'm not sure what you're trying to do there.

    The new clip you provided is in really poor shape. If you look at individual fields you'll see that many are torn -- the top part of the field comes from one field, the bottom part from another (usually a blend of two fields). Normally one would use TFM().TDecimate() on a film source like this but this problem requires something different. Fortunately, it looks like there are enough clean fields that you can do this:

    Code:
    Mpeg2Source("VTS_01_1.demuxed(1).d2v", CPU2="xxxxxx", Info=3) 
    QTGMC(preset="fast")
    SRestore(frate=23.976)
    SRestore() will preferentially remove frames where it sees blending, leaving only clear frames in this case.

    There's also a lot of ghosting from an overly strong temporal noise reduction filter. But there's not a lot you can do about that.
    Quote Quote  
  11. Member
    Join Date
    Aug 2017
    Location
    Sydney
    Search Comp PM
    hey So i have an issue with the Srestore.avsi script... as i'm using it with the d2v it keeps giving me an error "No Function named GScriptClip" thinking may not be the correct sRestore Script??
    Quote Quote  
  12. You need GRunt: http://avisynth.nl/index.php/GRunT

    SRestore requires other filters that you may not have: http://avisynth.nl/index.php/Srestore#Required_Plugins
    Last edited by jagabo; 15th May 2018 at 16:08.
    Quote Quote  
  13. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Thank you jagabo for pointing out my mistake with Blur(). And thank you for pointing out CPU2="xxxxxx" and Info=3! I had no idea my source video could benefit from those.

    My latest script now loads without an error, but something isn't right because the video looks the same as before.

    Current script:
    Code:
    LoadPlugin("C:\DVD\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\masktools2.dll")
    Import("C:\Program Files (x86)\AviSynth\plugins\Srestore_27h.avsi")
    clip1 = MPEG2Source("C:\DVD\1\VTS_01_1.d2v", CPU2="xxxxxx", Info=3).QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    clip2 = MPEG2Source("C:\DVD\2\VTS_01_1.d2v", CPU2="xxxxxx", Info=3).QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    mask = ImageSource("C:\Images\1.png")
    special = clip1.Trim(6665,7300)
    special = Overlay(special, Blur(special, 0.0, 1.0), mask=mask)
    mask = special.Trim(6665,7300).mt_binarize(180)
    mask = Overlay(mask, clip1.mt_binarize(180), mode="lighten")
    mask = Overlay(mask, clip1.loop(2,0,0).mt_binarize(180), mode="lighten")
    mask = mask.mt_expand().Blur(1.0).Blur(1.0).Blur(1.0)
    clip2.Trim(11,2178).FadeOut0(15) + \
    clip1.Trim(2169,6664) + \
    special + clip1.Trim(7301,0)
    Originally Posted by jagabo View Post
    There are other problems with your scirpt. You create a clip called mask from ImageSource() and convert it to RGB. Then you created a clip called mask (discarding the previous one) from clip1.Trim(...)... I'm not sure what you're trying to do there.
    The RGB conversion is because I thought RGB conversion was necessary for mask images to work properly. As for overriding last with last, I guess I'm still not clear on when a new line adds to last, and when it completely overrides it with a new last.
    Last edited by lomaidala; 17th May 2018 at 01:21.
    Quote Quote  
  14. thank you for pointing out CPU2="xxxxxx" and Info=3!
    Note that Mpeg2Source's deblocking is a too strong and loses detail in some areas. I usually use deblock_qed() instead. But you'll have to tune the deblocking strength settings to your video.

    Some general notes:

    Code:
    LoadPlugin("C:\DVD\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\masktools2.dll")
    Import("C:\Program Files (x86)\AviSynth\plugins\Srestore_27h.avsi")
    dll and avsi files in AviSynth's plugins folder should load automatically. So the latter two lines shouldn't be necessary.

    Code:
    mask = ImageSource("C:\Images\1.png")
    special = clip1.Trim(6665,7300)
    special = Overlay(special, Blur(special, 0.0, 1.0), mask=mask)
    What's 1.png? What is it's purpose? You're using it to blur parts of the frame but isn't that what the mask below is for?

    Code:
    mask = special.Trim(6665,7300).mt_binarize(180)
    mask = Overlay(mask, clip1.mt_binarize(180), mode="lighten")
    mask = Overlay(mask, clip1.loop(2,0,0).mt_binarize(180), mode="lighten")
    mask = mask.mt_expand().Blur(1.0).Blur(1.0).Blur(1.0)
    Now you are building a new mask -- and not using it for anything. The first line is attempting to build mask from frames 6665 to 7300 of the clip called special But special is only frames 6665 to 7300 of clip1. Ie, it is only 636 frames long. I'm not going to bother with the rest of the errors here.

    What I think you're trying to do is apply QTGMC().SRestore() to the bulk of your videos but apply the special deinterlacing (blurring only bright white parts of the frame) to frames 6675 though 7500 of clip1, the portion where QTGMC causes parts of the picture to bounce up and down. Aside from the other errors in the script, you need to perform that special deinterlacing on the video before QTGMC has been applied.

    Code:
    LoadPlugin("C:\DVD\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\masktools2.dll")
    Import("C:\Program Files (x86)\AviSynth\plugins\Srestore_27h.avsi")
    
    rawclip1 = MPEG2Source("C:\DVD\1\VTS_01_1.d2v", CPU2="xxxxxx", Info=3)
    clip1 = rawclip1.QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    clip2 = MPEG2Source("C:\DVD\2\VTS_01_1.d2v", CPU2="xxxxxx", Info=3).QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    
    special = rawclip1.Trim(6665,7300) # get the special part of rawclip1
    mask = special.Loop(2,0,0).mt_binarize(180) # build a mask from the previous frame of special
    mask = Overlay(mask, special.mt_binarize(180), mode="lighten") # add to the mask from the current frame of special
    mask = Overlay(mask, special.Trim(1,0).mt_binarize(180), mode="lighten") # add to the mask from the next frame of special
    mask = mask.mt_expand().Blur(1.0).Blur(1.0).Blur(1.0) # expand and blur the mask
    special = Overlay(special, Blur(special, 0.0, 1.0), mask=mask) # deinterlace (blur) only the bright areas of special
    special = special.TDecimate() #convert to 23.976 fps like the rest of the clips
    
    # now append all the wanted segments
    clip2.Trim(11,2178).FadeOut0(15) + \
    	clip1.Trim(2169,6664) + \
    	special + \
    	clip1.Trim(7301,0)
    I don't have the source clips so I haven't tested this script. So there might be some errors.
    Quote Quote  



Similar Threads