VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. Member
    Join Date
    Dec 2006
    Location
    Netherlands
    Search Comp PM
    I got a LD-rip on my HD. it's 5 VOB's big, 1 movie.
    The quality of the scenes vary. And I would very much like to apply different filters (sets)
    to just different isolated parts of the movie

    (ie. correct only the snow-scene wich is too dark,
    but not let the bright-filters affect the next scenes etc.)

    Is this possible within 1 Avisynth script?
    Quote Quote  
  2. Hi-

    Is this possible within 1 Avisynth script?

    Yes, by using either the ApplyRange or the Trim Filters:

    http://www.avisynth.org.ru/docs/english/corefilters/animate.htm
    http://www.avisynth.org.ru/docs/english/

    I find the Trim filter easier to use, as you don't have to list out all the arguments, as you do with ApplyRange:

    A=Trim(0,1000).Tweak(Sat=0)#greyscale the first 1001 frames
    B=Trim(1001,2000)#Nothing happens
    C=Trim(2001,3000).Sharpen(0.7)#add some sharpening between frames 2002 and 3001
    D=Trim(3001,0).Tweak(Cont=1.5)#increase the contrast from frame 3002 to the end of the video
    A+B+C+D
    Quote Quote  
  3. Member edDV's Avatar
    Join Date
    Mar 2004
    Location
    Northern California, USA
    Search Comp PM
    Where it gets fun is applying filters selectively within a frame defined by a soft mask or alpha. A typical example is using chroma key derived alpha to mask a filter effect only to that object in the scene.
    Quote Quote  
  4. Member
    Join Date
    Dec 2006
    Location
    Netherlands
    Search Comp PM
    @manono: Wow. Dunno what to say.
    I'm getting right at it (after a goodnights sleep )

    @edDV I thought doing filtering on parts of a frame would have to be
    done through photoshop and batch-processing (paaain!)

    anyway. thanks. I'll probably have some mor questins later on.


    [edit: I have a question right now]

    @manono:
    do you have to describe things like de-interlacing/crop/resize
    over and over again for each part of the video in such a script?
    Quote Quote  
  5. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by 20/20
    do you have to describe things like de-interlacing/crop/resize
    over and over again for each part of the video in such a script?
    Excuse me for butting in.
    If you're applying the same functions to every segment, you can either put them in a variable definition (like "clip", below), or apply them all at the end after joining the segments.

    (This is a script to remove a logo which appears between frames 154 and 9283, and resize to 720x576.)

    loadplugin("P:\AviSynth 2.5\Old\LoadPluginEx.dll")
    loadplugin("P:\AviSynth 2.5\Old\logotools.dll")

    logo=ImageSource("logo109.png").ConverttoYUY2()
    clip=AVISource("tw-109.avi",false).ConverttoYUY2()

    clip1=clip.Trim (1,153)
    clip2x=clip.Trim (154,9283)
    clip2=NoLogoAuto(clip2x,logo,1)
    clip3=clip.Trim (9284,0)

    clip1 ++ clip2 ++ clip3

    ConvertToYV12()
    LanczosResize(720,576,0,0,640,352)
    Quote Quote  
  6. do you have to describe things like de-interlacing/crop/resize
    over and over again for each part of the video in such a script?


    As AlanHK shows, filtering can be made to apply to both the entire video, or to only parts of it. Another (although perhaps not as elegant) way is like this:

    LeakKernelDeint(Order=1)#deinterlace the whole thing
    A=Trim(0,1000).Tweak(Sat=0)
    B=Trim(1001,2000)
    C=Trim(2001,3000).Sharpen(0.7)
    D=Trim(3001,0).Tweak(Cont=1.5)
    A+B+C+D
    Crop(8,0,-8,0).LanczosResize(512,384)#crop and resize the whole thing
    Quote Quote  
  7. Member edDV's Avatar
    Join Date
    Mar 2004
    Location
    Northern California, USA
    Search Comp PM
    Originally Posted by 20/20

    @edDV I thought doing filtering on parts of a frame would have to be
    done through photoshop and batch-processing (paaain!)
    Naw, I do it every day with Vegas, Premiere or Final Cut Pro in full motion. Object alpha + soft keyframed masks make most anything possible.
    Quote Quote  
  8. Member
    Join Date
    Dec 2006
    Location
    Netherlands
    Search Comp PM
    Originally Posted by manono
    Hi-

    I find the Trim filter easier to use, as you don't have to list out all the arguments, as you do with ApplyRange:

    A=Trim(0,1000).Tweak(Sat=0)#greyscale the first 1001 frames
    B=Trim(1001,2000)#Nothing happens
    C=Trim(2001,3000).Sharpen(0.7)#add some sharpening between frames 2002 and 3001
    D=Trim(3001,0).Tweak(Cont=1.5)#increase the contrast from frame 3002 to the end of the video
    A+B+C+D
    It looks very straight forward.

    Can I apply things like crop, resize, degrainmedian (for th whole video) at the very beginning.
    like this?

    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MSharpen.dll")
    LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fft3dfilter.dll")
    DGDecode_mpeg2source("F:\SW6\VIDEO_TS\VTS_01_PGC_0 1_1.d2v")

    Crop( 8, 54, -8, -50)
    Lanczos4Resize(656,304) # Lanczo4 (Sharp)
    DeGrainMedian(limitY=5,limitUV=3,mode=5)

    A=Trim(0,1000).blabla.another
    B=Trim(1001,2000).functionbla.another
    C=Trim(2001,3000).functionbla.another.
    D=Trim(3001,0).function.function.function
    A+B+C+D

    ?
    Quote Quote  
  9. Can I apply things like crop, resize, degrainmedian (for th whole video) at the very beginning.
    like this?


    I thought I answered that question in my previous post by showing how you can filter the entire thing (using a deinterlace as an example) before doing the filtering on different parts. The answer is yes.
    Quote Quote  
  10. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by 20/20
    Can I apply things like crop, resize, degrainmedian (for th whole video) at the very beginning.
    It would work. Try it, only takes a minute to run in VDUBMOD.

    But you should consider the order of operations. For instance, I would resize at the end, after doing any cleanup filters like degrain, as otherwise the scaling will probably make any defects worse.
    Quote Quote  
  11. Member grannyGeek's Avatar
    Join Date
    Apr 2006
    Location
    Land of the Rising Sun
    Search Comp PM
    Hi, quick suggestion -

    using stickboy's JDL_ApplyRange lets you use named parameters, very handy if a filter has a dozen parameters. I think the aviSynth internal ApplyRange forces you to list all the existing parameters for the filter.
    But it seems like JDL_ApplyRange won't let you use string variables with named parameters. If anybody knows how to do that, I hope they post a solution.

    you can get this filter, along with some other handy utilities at
    http://avisynth.org/stickboy/
    grannyGeek ~~
    Antique Newbie
    Quote Quote  
  12. Member
    Join Date
    Dec 2006
    Location
    Netherlands
    Search Comp PM
    Thank you, all of you 8)
    I find doing it the 'trim' way very easy to do.

    though i'm now having trouble with smeary/smudgy video when movement occurs.
    Dunno if it's because of the convolution3d, fft3dfilter or warpsharp.

    btw. doing it with (i guess) (recuriing) functions you define yourself within a script,
    is somthing I do not understand how to yet.
    It looks pretty comlicated, though I get the general idea.
    Quote Quote  
  13. Member
    Join Date
    Oct 2006
    Location
    Australia
    Search Comp PM
    Thanks everyone for all that

    A=Trim(0,800).SomeRandomFilter()
    B=Trim(801,1500).AnotherRandomFilter()
    A+B

    . . stuff. Was always wondering how to do apply different filters to different parts of the video

    EDIT: Just realised that I was overlapping frame 800
    Quote Quote  
  14. though i'm now having trouble with smeary/smudgy video when movement occurs.

    If these are from laserdisc, and if these are movies, then they should probably be IVTC'd. Have you had a look before applying the filters to see if you get the same thing?
    Quote Quote  
  15. Member
    Join Date
    Dec 2006
    Location
    Netherlands
    Search Comp PM
    I'm clueless to all the exotic forms of IVTC.
    I let Megui do a analasys and it said my source was 'progressive'
    (whatever that means)
    Quote Quote  
  16. Sorry, but I only now noticed you're from a PAL country. No IVTC. Then that kind of appearance can be gotten from strong temporal filtering, such as from some of the stronger settings of convolution3d. Maybe even a strong spatial filter like Warpsharp. I don't use fft3dfilter so I'm not sure what kind of artifacts it might produce. I'd vote for convolution3d, especially if you're using one of those low-quality presets. You can remove one at a time from the script and probably figure out which one is causing it.
    Quote Quote  



Similar Threads

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