VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. Hello all.
    I have an old animated film that im trying to cleanup, I have it looking pretty good all things considered. Im using vapoursynth via Hybrid to do it (for ease of testing, im not scared to only use VS).
    I have a situation where different scenes need different tweaks to not look awful (compression artifacts/banding, etc etc), and im wondering what the best course of action would be for this?

    Should I chop up the video into different sections (losslessly) and fix them up, then concat everything, or is there some way to using VS on only a part of the video?
    Problem im thinking is if I cut up the video, I could have syncing issues from cutting.

    Or maybe there is something im missing that I could do, im no expert. If anyone has any suggestions, please let me know!
    Quote Quote  
  2. I assume VS is similar to AVS: you can trim the input video into segments, filter each segment differently, then join the segments back together at the end. In AviSynth it would look something like:

    Code:
    source = WhateverSource("filename.ext) # get source video
    
    part1 = Trim(source, 0, 1000).FilterSequence1() # break it into sections, part1 is frames 0 to 1000 and it's filtered in one way
    part2 = Trim(source, 1001,2000).FilterSequence2() # part2 is frames 1001 to 2000 and it's filtered in a different way
    part3 = Trim(source, 2001, 0).FilterSequence3() # part3 is frames 2001 to the end and it's filtered a third way
    
    part1++part2++part3 # part1 part2 and part3 are joined back together
    Last edited by jagabo; 15th Jun 2023 at 07:18. Reason: Fixed a bug in the sample script
    Quote Quote  
  3. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    and if you experience troubles with the audio (rarely happens, even with AlignedSplice ++) dub the original audio to filtered video (if you do not add/delete frames in the filtering)

    Code:
    source = WhateverSource("filename.ext) # get source video
    
    part1 = Trim(0, 1000).FilterSequence1() # break it into sections, part1 is frames 0 to 1000 and it's filtered in one way
    part2 = Trim(1001,2000).FilterSequence2() # part2 is frames 1001 to 2000 and it's filtered in a different way
    part3 = Trim(2001, 0).FilterSequence3() # part3 is frames 2001 to the end and it's filtered a third way
    
    video_filtered=part1++part2++part3
    
    # use audio from original clip
    audio=source
    video_filtered_audio=audioDub(video_filtered,audio)
    
    return(video_filtered_audio)
    Quote Quote  
  4. You could:
    • enable "Filtering->Vapoursynth->Misc->UI->Show 'Apply only to'-controls". These controls, appear behind each filter that supports them, allow applying a filter only to a range of frames. (Hybrid does not allow this for each filter, cropping, resizing, letterbox, deinterlacing, frame rate changes can only be applied for the whole clip.)
    • enable "Filtering->Vapoursynth->Filter Order/Queue->Use Filter Queue". This way, Hybrid can use a filter multiple times. Note that each filter needs to be added to the filter queue (there are now +/- controls for each filter, to add or remove a specific filter setting from the queue)
    Combining these, you can filter each section of a clip whoever you want.

    Alternatively, you can write your own script in Vapoursynth/Avisynth and use it as source for Hybrid.
    Hybrid has a bunch of options for Vapoursynth which are disabled by default, to keep it a bit more approachable for users. *gig*
    (No, Hybrid is not meant to be 'easy click and be happy' since there are too many options for that. If you want it simple, you need to simplify.)


    Cu Selur

    Ps.: Hybrid does not offer something similar for Avisynth, if you want to use Avisynth, you are best off writing the script on your own. (I even would recommend, then to not use Hybrid at all, but also write the encoding part on your own, since, for me, using Hybrid - or any other gui - just seems bothersome in that cast.)

    PPs.: Splitting the source into multiple scene can also make sense depending on what you are doing, since sometimes one-script-to-rule-them-all might work, but can get really complex, and it might get hard to get an overview.
    Last edited by Selur; 14th Jun 2023 at 12:55.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  5. It could be done without trimming, just using conditioning function what to do with particular n-th frame. Module animate does that.
    Code:
    import animate
    def filter1(clip,*args):
        return clip.std.BoxBlur()
    
    def filter2(clip, *args):
        return clip.std.Expr(['x 50 -','',''])
    
    def filter3(clip, *args):
        return clip.std.Expr(['x 50 +','',''])
    
    clip = core.lsmas.LibavSMASHSource('source.mp4')
    
    MAP = [ 
                 (300, 400),    [filter1],
                 (401, 600),    [filter1, filter2],
                 (0, 1000),     [filter3]
           ]
    
    clip = animate.run(clip, MAP)
    clip.set_output()
    those frame regions could overlap, filters could be chained, also filters could be applied on a region within a frame only, check manual
    Quote Quote  
  6. Thanks for all the great replies!
    I think I have an idea on what to do now, I will test them out once I have some free time.
    Quote Quote  



Similar Threads

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