VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    In the past, when using Stack, I have been editing the videos so they start at the same frame. I'm finding this annoying and tedious!

    So, what I thought I'd try to do is "trim" each clip, then apply the stack. Unfortunately, I have crashed and burned at every try. My code currently is:

    Code:
    clip1=AVISource("I:\vid1.avi")
    clip2=AVISource("I:\vid2.avi")
    
    #trim(clip1, 255, 0)
    #trim(clip2, 236, 0)
    
    
    StackHorizontal(trim(clip1, 255, 0), trim(clip2, 236, 0))
    This just returns a standard Stack ie starting at the first frame of each clip.

    I have tried with the two commented-out trim commands but didn't achieve what I want. I also added the "trim" to the AVISource lines but no joy.

    I also tried using clip 3 and 4 from trimmed clips 1 and 2 in the script but no luck either:

    Code:
    clip3=trim(clip1, 255, 0)
    clip4=trim(clip2, 236, 0)
    Is what I am trying to do achievable in one script and if so, how?

    Thanks very much.
    Quote Quote  
  2. Originally Posted by Alwyn View Post
    I also added the "trim" to the AVISource lines but no joy.
    But how did you add them ?

    Easiest way for most people would be to add the Trim to the clip1 , clip2 lines

    Code:
    clip1=AVISource("I:\vid1.avi").Trim(255, 0)
    clip2=AVISource("I:\vid2.avi").Trim(236, 0)
    
    StackHorizontal(clip1, clip2)
    or

    Code:
    clip1=AVISource("I:\vid1.avi")
    clip2=AVISource("I:\vid2.avi")
    
    StackHorizontal(clip1.Trim(255, 0), clip2.Trim(236, 0) )
    Quote Quote  
  3. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Thanks muchly PDR! Just what the doctor ordered.

    But how did you add them ?
    Not the right way, whoops. I put the trim stuff in the file name, not after, and of course it wouldn't open.
    Quote Quote  
  4. I'd probably do it similar to the way poisondeathray suggested, but what am I missing? Your original method should work.

    SomeVideo
    clip1 = last.Frame()
    clip2 = last.greyscale().Frame()

    StackHorizontal(trim(clip1, 255, 0), trim(clip2, 236, 0))

    Image
    [Attachment 85740 - Click to enlarge]
    Quote Quote  
  5. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Thanks HH. I think PDR's method is more "Logical", if I could put it that way.

    My main struggle was the cursed subtitling and visualising all the brackets. I got there in the end but boy...

    On the subject of code, at one stage I tried laying out the code so I could see more clearly what was going on, like this:

    Code:
    StackVertical(
    StackHorizontal(
    clip1.subtitle("JVC HR-S5700 SVHS to USBLive2",size=24),
    clip2.subtitle("Panasonic NV-VP33 to USBLive2",size=24),
    clip3.subtitle("Panasonic NV-VP33 Composite to GV-USB2",size=24)),
    StackHorizontal(
    clip4.subtitle("JVC HR-S5700 SVHS to Pioneer DVR-645H to USBLive2",size=24),
    clip5.subtitle("Panasonic NV-VP33 Composite to Pioneer DVR-645H to USBLive2",size=24),
    clip6.subtitle("Panasonic NV-VP33 Composite to Pioneer DVR-645H to GV-USB2",size=24))
    )
    Of course, it didn't work.

    Is there any way of laying out code like that so that it will work in AVISynth?
    Quote Quote  
  6. Originally Posted by Alwyn View Post
    Thanks HH. I think PDR's method is more "Logical", if I could put it that way.

    My main struggle was the cursed subtitling and visualising all the brackets. I got there in the end but boy...

    On the subject of code, at one stage I tried laying out the code so I could see more clearly what was going on, like this:

    Code:
    StackVertical(
    StackHorizontal(
    clip1.subtitle("JVC HR-S5700 SVHS to USBLive2",size=24),
    clip2.subtitle("Panasonic NV-VP33 to USBLive2",size=24),
    clip3.subtitle("Panasonic NV-VP33 Composite to GV-USB2",size=24)),
    StackHorizontal(
    clip4.subtitle("JVC HR-S5700 SVHS to Pioneer DVR-645H to USBLive2",size=24),
    clip5.subtitle("Panasonic NV-VP33 Composite to Pioneer DVR-645H to USBLive2",size=24),
    clip6.subtitle("Panasonic NV-VP33 Composite to Pioneer DVR-645H to GV-USB2",size=24))
    )
    Of course, it didn't work.

    Is there any way of laying out code like that so that it will work in AVISynth?
    You would need to use the line break character , backslash "\" for avisynth , to format it that way


    Code:
    StackVertical( \
    StackHorizontal( \
    clip1.subtitle("JVC HR-S5700 SVHS to USBLive2",size=24), \
    clip2.subtitle("Panasonic NV-VP33 to USBLive2",size=24), \
    clip3.subtitle("Panasonic NV-VP33 Composite to GV-USB2",size=24)), \
    StackHorizontal( \
    clip4.subtitle("JVC HR-S5700 SVHS to Pioneer DVR-645H to USBLive2",size=24), \
    clip5.subtitle("Panasonic NV-VP33 Composite to Pioneer DVR-645H to USBLive2",size=24), \
    clip6.subtitle("Panasonic NV-VP33 Composite to Pioneer DVR-645H to GV-USB2",size=24)))
    Quote Quote  
  7. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Awesome, thanks PDR. That works great.
    Quote Quote  
  8. Stacking images next to each other could play a tricks on you. One image is closer to the window and can look different, or other scenarios. To compare images I find the best just to use a tool that can switch images to a view while images are stacked on top of each other. AvsPmod can do that for avisynth scripts, I presume.
    Quote Quote  
  9. Originally Posted by _Al_ View Post
    Stacking images next to each other could play a tricks on you. One image is closer to the window and can look different, or other scenarios. To compare images I find the best just to use a tool that can switch images to a view while images are stacked on top of each other. AvsPmod can do that for avisynth scripts, I presume.
    Or use Interleave() instead of stacking. With Interleave(), a screen magnifier (like the one built in to Windows), and stepping through the video frame by frame, you can easily see minute differences.

    So instead of StackHorizontqal(A, B), use Interleave(A, B).

    I use VirtualDub 2 to view my AVS scripts. But any program that lets you step through frame by frame (backward and forward) is ok.

    Stacking is good for checking temporal alignment of two videos. Interleaving is good for checking for before/after filtering changes, before/after lossy encoding, etc.
    Quote Quote  
  10. I've been fooled on occasion when stacking images due to my monitor's limited viewing angle. And if an image is darker on one edge than the other, or even when it's not, it can still mess with your brain.
    https://en.wikipedia.org/wiki/Cornsweet_illusion

    Stacking is useful if you're not comparing the quality though, otherwise assuming the videos are the same, interleaving works well for comparing clips.

    clip1 = Subtitle("clip1")
    clip2 = TemporalDegrain2(grainlevel=1).Subtitle("clip2")
    clip3 = MCDegrainSharp.Subtitle("clip3")
    Interleave(clip1, clip2, clip3)

    Edit: I took too long to post and jagabo beat me to it.
    Quote Quote  
  11. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    I'm using Stack to compare motion in videos.
    Image Attached Files
    Quote Quote  
  12. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    Originally Posted by Alwyn View Post
    I'm using Stack to compare motion in videos.
    Allrigth, but swap them for multiple checks, to do not have problems of "false judgement by position"
    Quote Quote  
  13. To change the subject for a second...

    I was reading a pdf the wikipedia page I linked to earlier used as a reference and found an image that apparently even confuses my color-picker, because it's certain the flat area of both objects in the picture are the same color, yet obviously they're not the same, no matter what the color-picker says.

    Image
    [Attachment 85769 - Click to enlarge]


    Sorry about the tangent.
    Quote Quote  



Similar Threads

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