VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Take the French flag for example. If you had a video of that, would it be possible to cut out the white middle section leaving just the blue and red with nothing in between? I've googled phrases such as 'avisynth trim from centre' with no luck so I'm quite prepared for the answer to be 'No'. In which case, could two videos - a cropped blue stripe and a cropped red stripe - be made into one by some form of overlaying (sounds even more unlikely now that I see it in print but, you know, stranger things...)?

    Thanks.
    Quote Quote  
  2. Crop to the left section, crop to the right section, Stick them together by using StackHorizontal(left, right)
    Quote Quote  
  3. Here is a concrete example

    From
    https://en.wikipedia.org/wiki/File:Flag_of_France_(2020%E2%80%93present).svg

    Code:
    orig=ImageSource("Flag_of_France_(2020–present).svg.png")
    left=orig.crop(0,0,-342,0,true)
    right=orig.crop(342,0,0,0,true)
    
    stackhorizontal(left,right)
    (This is overcropped slightly, it's because of the way the wikipeida graphic was made. The "blue" side was done incorrectly, there pixels are not a 1px pixel perfect edge)
    Image Attached Thumbnails Click image for larger version

Name:	Flag_of_France_(2020–present).svg.png
Views:	10
Size:	708 Bytes
ID:	72622  

    Image Attached Images  
    Last edited by poisondeathray; 23rd Jul 2023 at 15:33.
    Quote Quote  
  4. As an AviSynth function:

    Code:
    #############################################
    #
    # removes inner columns from StartX to Endx-1
    #
    #############################################
    
    function RemoveInnerColumns(clip c, int StartX, int EndX)
    {
        StackHorizontal(Crop(c, 0, 0, StartX, -0), Crop(c, EndX, 0, -0, -0))
    }
    
    #############################################
    Call with something like:

    Code:
    RemoveInnerColumns(171, 341)
    Note that subsampled chroma (YUY2, YV12) may restrict you to even numbers.
    Quote Quote  
  5. Thanks guys, I really appreciate the time and effort you've made. In case you're interested, here's what I'm working on:
    https://www.youtube.com/watch?v=Q7aKeUBwN7w
    Rosie and Gill have always been my Legs & Co favourites so I thought it'd be a fun exercise to isolate them and it worked a treat with jagabo's neat function:
    Code:
    function RemoveInnerColumns(clip c, int StartX, int EndX)
    {
        StackHorizontal(Crop(c, 0, 0, StartX, -0), Crop(c, EndX, 0, -0, -0))
    }
    global MeGUI_darx = 4
    global MeGUI_dary = 3
    LoadPlugin("D:\MeGUI 2944 64bit\tools\lsmash\LSMASHSource.dll")
    a=LSMASHVideoSource("D:\L&C Feel the Need 1977.mp4")
    b=LSMASHaudioSource("D:\L&C Feel the Need 1977.mp4")
    audiodub(a,b)
    
    a=fi(53552,666,50).RemoveInnerColumns(428, 820).crop(154,4,-156,0,true).AddBorders(98, 0, 98, 0, $000000)
    b=trim(53552,59668).fin(150).fout(200).RemoveInnerColumns(428, 820).crop(154,4,-156,0,true).AddBorders(98, 0, 98, 0, $000000)
    c=fo(59668,666,33).RemoveInnerColumns(428, 820).crop(154,4,-156,0,true).AddBorders(98, 0, 98, 0, $000000)
    a++b++c
    The original vid is sidebarred 4:3 and I've cropped the sidebars to give a sharper line and added back what was cropped from the middle so as to preserve the AR. 'Fi' and 'fo' are custom functions for fadein and fadeout.

    poisondeathray, you're suggestion worked well apart from the fact that my MeGui doesn't load the audio. Is there something I need to change in my script:
    Code:
    LoadPlugin("D:\Free\MeGUI 2944 64bit\tools\lsmash\LSMASHSource.dll")
    a=LSMASHVideoSource("D:\L&C Feel the Need 1977.mp4").showframenumber(size=50,x=180,y=33)
    b=LSMASHaudioSource("D:\L&C Feel the Need 1977.mp4")
    audiodub(a,b)
    
    left=a.crop(154,4,-852,0,true).AddBorders(154, 0, 0, 0, $000000)
    right=a.crop(822,4,-156,0,true).AddBorders(0, 0, 156, 0, $000000)
    stackhorizontal(left,right)
    trim(53552,59691).fadein0(66).fadeout0(66)
    Thanks again.
    Quote Quote  
  6. Originally Posted by pooksahib View Post

    poisondeathray, you're suggestion worked well apart from the fact that my MeGui doesn't load the audio. Is there something I need to change in my script:
    I made the additions in red

    You need to reference the audiodub version . Right now you are referencing "a", which is only the video . Let's call the AudioDub version "c"

    Code:
    LoadPlugin("D:\Free\MeGUI 2944 64bit\tools\lsmash\LSMASHSource.dll")
    a=LSMASHVideoSource("D:\L&C Feel the Need 1977.mp4").showframenumber(size=50,x=180,y=33)
    b=LSMASHaudioSource("D:\L&C Feel the Need 1977.mp4")
    c=audiodub(a,b)
    
    left=c.crop(154,4,-852,0,true).AddBorders(154, 0, 0, 0, $000000)
    right=c.crop(822,4,-156,0,true).AddBorders(0, 0, 156, 0, $000000)
    stackhorizontal(left,right)
    trim(53552,59691).fadein0(66).fadeout0(66)
    Quote Quote  
  7. pooksahib, keep in mind that AviSynth assumes the name "last" when you don't specify a stream by name. This is true for both inputs and outputs. Your second script in post #5 gets the video and audio streams from LSMASH and explicitly names the "a" and "b". You then use AudioDub() to join a and b into a new stream. You didn't specify a name for that new stream so AviSynth used the default name "last". Later in the script you Crop() bits from a, the video only stream, not from last. That's why you had no audio.
    Last edited by jagabo; 24th Jul 2023 at 12:49.
    Quote Quote  
  8. Noted with many thanks.
    Quote Quote  



Similar Threads

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