VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. script

    Mpeg2Source("I:\VIDEO_TS.d2v", CPU2="ooooxx")
    return
    \ fa.Trim(0, 16785)
    \ + fb.Trim(16786, 16817)
    \ + fa.Trim(16818, 17384)
    \ + fb.Trim(17385, 17469)
    \ + fa.Trim(17470, 17563)
    \ + fb.Trim(17564, 17596)
    \ + fa.Trim(17597, 18849)
    \ + fb.Trim(18850, 18964)
    \ + fa.Trim(18965, 19189)
    \ + fb.Trim(19190, 19288)
    \ + fa.Trim(19289, 21519)
    \ + fb.Trim(21520, 21606)
    \ + fa.Trim(21607, 22061)
    \ + fb.Trim(22062, 22195)
    \ + fa.Trim(22196, 27773)
    \ + fb.Trim(27774, 27797)
    \ + fa.Trim(27798, 29724)
    \ + fb.Trim(29725, 29733)
    \ + fa.Trim(29734, 30767)
    \ + fb.Trim(30768, 30931)
    \ + fa.Trim(30932, 32137)
    \ + fb.Trim(32138, 32378)
    \ + fa.Trim(32378, 32875)
    \ + fb.Trim(32876, 33032)
    \ + fa.Trim(33033, 33930)
    \ + fb.Trim(33931, 33979)
    \ + fa.Trim(33980, 37811)

    function fa(clip C)
    {
    C
    TFM()
    TDecimate(Mode=1)
    ColorMatrix(mode="rec.601->rec.709")
    ColorYUV(cont_y=5, cont_u=-40, cont_v=8, gamma_y=-15)
    Crop(4,0,-0,-0)
    McTemporalDenoise(settings="Low")
    nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    Sharpen(0.7)
    McTemporalDenoise(settings="Medium")
    Hysteria(strength=3.6, maxchg=26,lowthresh=12)
    Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3)
    Blur(0.8)
    return Last
    }

    function fb(clip C)
    {
    C
    QTGMC(FPSDivisor=2)
    TDecimate(Mode=1)
    ColorMatrix(mode="rec.601->rec.709")
    ColorYUV(cont_y=5, cont_u=-40, cont_v=8, gamma_y=-15)
    Crop(4,0,-0,-0)
    McTemporalDenoise(settings="Medium")
    nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    Sharpen(0.7)
    Hysteria(strength=3.6, maxchg=26,lowthresh=12)
    Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3)
    Blur(0.8)
    return Last
    }
    Quote Quote  
  2. Did you really mean to call MCTD twice in fa()? You may be running out of memory.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    Did you really mean to call MCTD twice in fa()? You may be running out of memory.
    yes

    if i reduce the number of trims it works

    how can i make it work ?
    Quote Quote  
  4. Using a random DVD MPEG2 video your script crashed on my computer too. But not after modifying it to use ReplaceFramesSimple():

    Code:
    Mpeg2Source(I:\VIDEO_TS.d2v", CPU2="ooooxx") 
    va = fa()
    vb = fb()
    ReplaceFramesSimple(va, vb, mappings="
    [16786 16817][17385 17469][17564 17596][18850 18964][19190 19288]
    [21520 21606][22062 22195][27774 27797][29725 29733][30768 30931]
    [32138 32378][32876 33032][33931 33979][33980 37811]")
    Trim(0,37811) # in case va is longer than 37812 frames.
    return(last)
    
    
    function fa(clip C)
    {
    C
    TFM()
    TDecimate(Mode=1)
    ColorMatrix(mode="rec.601->rec.709")
    ColorYUV(cont_y=5, cont_u=-40, cont_v=8, gamma_y=-15)
    Crop(4,0,-0,-0)
    McTemporalDenoise(settings="Low")
    nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    Sharpen(0.7)
    McTemporalDenoise(settings="Medium")
    Hysteria(strength=3.6, maxchg=26,lowthresh=12)
    Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3)
    Blur(0.8)
    return Last
    }
    
    function fb(clip C)
    {
    C
    QTGMC(FPSDivisor=2)
    TDecimate(Mode=1)
    ColorMatrix(mode="rec.601->rec.709")
    ColorYUV(cont_y=5, cont_u=-40, cont_v=8, gamma_y=-15)
    Crop(4,0,-0,-0)
    McTemporalDenoise(settings="Medium")
    nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    Sharpen(0.7)
    Hysteria(strength=3.6, maxchg=26,lowthresh=12)
    Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3)
    Blur(0.8)
    return Last
    }
    Quote Quote  
  5. Originally Posted by jagabo View Post
    Using a random DVD MPEG2 video your script crashed on my computer too. But not after modifying it to use ReplaceFramesSimple():

    Code:
    Mpeg2Source(I:\VIDEO_TS.d2v", CPU2="ooooxx") 
    va = fa()
    vb = fb()
    ReplaceFramesSimple(va, vb, mappings="
    [16786 16817][17385 17469][17564 17596][18850 18964][19190 19288]
    [21520 21606][22062 22195][27774 27797][29725 29733][30768 30931]
    [32138 32378][32876 33032][33931 33979][33980 37811]")
    Trim(0,37811) # in case va is longer than 37812 frames.
    return(last)
    
    
    function fa(clip C)
    {
    C
    TFM()
    TDecimate(Mode=1)
    ColorMatrix(mode="rec.601->rec.709")
    ColorYUV(cont_y=5, cont_u=-40, cont_v=8, gamma_y=-15)
    Crop(4,0,-0,-0)
    McTemporalDenoise(settings="Low")
    nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    Sharpen(0.7)
    McTemporalDenoise(settings="Medium")
    Hysteria(strength=3.6, maxchg=26,lowthresh=12)
    Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3)
    Blur(0.8)
    return Last
    }
    
    function fb(clip C)
    {
    C
    QTGMC(FPSDivisor=2)
    TDecimate(Mode=1)
    ColorMatrix(mode="rec.601->rec.709")
    ColorYUV(cont_y=5, cont_u=-40, cont_v=8, gamma_y=-15)
    Crop(4,0,-0,-0)
    McTemporalDenoise(settings="Medium")
    nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    Sharpen(0.7)
    Hysteria(strength=3.6, maxchg=26,lowthresh=12)
    Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3)
    Blur(0.8)
    return Last
    }
    it works ! thanks

    what does it do differently ?

    my script basically tell use A or B in the different trimmed sections
    your replaces or something ?
    Quote Quote  
  6. I think AviSynth creates a new video stream with each of your calls to fa() and fb(), 27 different streams, each calling memory intensive filters like MCTD and QTGMC. I'm my version fa() and fb() are called only once, so only two streams are created. If you modified your code to do something like:

    Code:
    Mpeg2Source("I:\VIDEO_TS.d2v", CPU2="ooooxx")
    va = fa()
    vb = fb()
    return(va.Trim(0, 16785)
    \ + vb.Trim(16786, 16817)
    \ + va.Trim(16818, 17384)...
    It probably would have worked.
    Last edited by jagabo; 7th Apr 2017 at 18:42.
    Quote Quote  
  7. Originally Posted by jagabo View Post
    I think VirtualDub creates a new video stream with each of your calls to fa() and fb(), 27 different streams, each calling memory intensive filters like MCTD and QTGMC. I'm my version fa() and fb() are called only once, so only two streams are created. If you modified your code to do something like:

    Code:
    Mpeg2Source("I:\VIDEO_TS.d2v", CPU2="ooooxx")
    va = fa()
    vb = fb()
    return(va.Trim(0, 16785)
    \ + vb.Trim(16786, 16817)
    \ + va.Trim(16818, 17384)...
    It probably would have worked.
    does your code does what my script intended? the parts with fa the default is applied to them and to fb the QTGMC...

    it doesnt replace ALL of the trimmed sections with "fb" (QTGMC one) right?

    Edit:nvm
    Last edited by zanzar; 7th Apr 2017 at 19:05.
    Quote Quote  
  8. Why don't you just check it and find out?
    Last edited by jagabo; 7th Apr 2017 at 20:24.
    Quote Quote  
  9. I had some time so I double checked my script in post 5. The last segment in ReplaceFramesSimple, [33980 37811], should be removed. The script in post 7 is obviously just a fragment -- you should be able to figure out the rest.
    Quote Quote  
  10. Originally Posted by jagabo View Post
    I had some time so I double checked my script in post 5. The last segment in ReplaceFramesSimple, [33980 37811], should be removed. The script in post 7 is obviously just a fragment -- you should be able to figure out the rest.
    yes i figured it out myself and that you only used the "fb" frames

    i already finished encoding
    Quote Quote  
  11. Originally Posted by jagabo View Post
    I had some time so I double checked my script in post 5. The last segment in ReplaceFramesSimple, [33980 37811], should be removed. The script in post 7 is obviously just a fragment -- you should be able to figure out the rest.
    crap i forgot 2 sections that also has bad interlacing and need a fix.

    [28819 28879][26199 26421]

    the video is already encoded ...

    what is the fastest way to fix this sections?
    Quote Quote  
  12. Originally Posted by zanzar View Post
    crap i forgot 2 sections that also has bad interlacing and need a fix.

    [28819 28879][26199 26421]

    the video is already encoded ...

    what is the fastest way to fix this sections?
    The best and easiest way is to add those two sections to the script and encode the whole video again.
    Quote Quote  
  13. Originally Posted by jagabo View Post
    Originally Posted by zanzar View Post
    crap i forgot 2 sections that also has bad interlacing and need a fix.

    [28819 28879][26199 26421]

    the video is already encoded ...

    what is the fastest way to fix this sections?
    The best and easiest way is to add those two sections to the script and encode the whole video again.
    what would be the downside by using something like this ?

    Code:
    LWLibavVideoSource("I:1.mkv") # "1" is the encoded video with the missing parts 
    vb = fb()
    ReplaceFramesSimple(vb, mappings="[28819 28879][26199 26421]")
    return(last)
    
    function fb(clip C)
    {
    C
    Mpeg2Source("I:\VIDEO_TS.d2v", CPU2="ooooxx")
    QTGMC(FPSDivisor=2)
    TDecimate(Mode=1)
    ColorMatrix(mode="rec.601->rec.709")
    ColorYUV(cont_y=5, cont_u=-10, cont_v=8, gamma_y=-15)
    Crop(4,0,-0,-0)
    McTemporalDenoise(settings="Medium")
    nnedi3_rpow2(2, cshift="spline36resize", fwidth=1280, fheight=720)
    Sharpen(0.7)
    Hysteria(strength=3.6, maxchg=26,lowthresh=12)
    Dehalo_alpha(rx=3, ry=3, darkstr=0.3, brightstr=0.3)
    Blur(0.8)
    return Last
    }
    Quote Quote  
  14. Re-compressing the video will cause a loss of quality.
    Quote Quote  



Similar Threads

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