VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Member
    Join Date
    Apr 2017
    Location
    Within the Oort Cloud
    Search Comp PM
    Hi. First post. Howdy.

    It appears that Dissolve and/or Fade change the total number of frames in .avs scripts. When I add up the total number of frames in the avs script and then load the avs script in Vdub the total number of frames is different. My real world example below shows a difference of 822 frames vs 1368 frames for the same script. I have run some basic tests which appear to support this hypothesis. Of course I may be doing something stupid. Any guidance would be greatly appreciated. Please let me know if I can clarify anything. Ffmpeg also borks on the same script which leads me to think this is an Avisynth issue. Or my lack of avs coding skills.

    Test1.avs = 200 frames long = Expected behaviour

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    video = v1 + v2
    return video
    Test2.avs with return Dissolve = 195 frames long = Unexpected behaviour

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    return Dissolve(v1, v2, 5)
    Test3.avs with fadeOut(fadeIn = 202 frames long = Unexpected behaviour

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    fadeOut(fadeIn(v1 + v2, 60), 60)
    Test4.avs with dissolve and fade = 197 frames long = Unexpected behaviour

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    v3 = Dissolve(v1, v2, 5)
    fadeOut(fadeIn(v3, 60), 60)
    Test5.avs explicity specifying frame rates on dissolve and fade = 197 frames = Unexpected behaviour

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24, start=1, end=100)
    v2=ImageReader("2.png", fps=24, start=1, end=100)
    v3 = Dissolve(v1, v2, 5, 24)
    fadeOut(fadeIn(v3, 60, $000000, 24), 60, $000000, 24)
    realExample = 822 frames long = Expected behaviour

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24).trim(1,106)
    v3=ImageReader("3.png", fps=24).trim(1,471)
    v9=ImageReader("9.png", fps=24).trim(1,58)
    v10=ImageReader("10.png", fps=24).trim(1,35)
    v11=ImageReader("11.png", fps=24).trim(1,152)
    video = v1 + v3 + v9 + v10 + v11
    return video
    realExample = 1368 frames long

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    v1=ImageReader("1.png", fps=24).trim(1,106)
    v3=ImageReader("3.png", fps=24).trim(1,471)
    v9=ImageReader("9.png", fps=24).trim(1,58)
    v10=ImageReader("10.png", fps=24).trim(1,35)
    v11=ImageReader("11.png", fps=24).trim(1,152)
    d1 = Dissolve(v1, v3, 5)
    d3 = Dissolve(v3, v9, 5)
    d9 = Dissolve(v9, v10, 5)
    d10 = Dissolve(v10, v11, 5)
    fadeOut(fadeIn(d1 + d3 + d9 + d10,60),60)
    I'm hoping you might be able to point me in the right direction so I can code my .avs script correctly.

    Thanks
    Quote Quote  
  2. How else would dissolve() fade one clip into the other? The last e.g. 5 frames of clip a and the first 5 frames of clip b are blended into each other so the total resulting length is [length of a] + [length of b] - 5.

    http://avisynth.nl/index.php/Dissolve
    http://avisynth.nl/index.php/Fade
    Quote Quote  
  3. The Fade page clearly states it adds frames. If you want to keep the same number of frames, use FadeIn0 and FadeOut0 and FadeIO0.

    The Dissolve page clearly states the frames overlap, so, of course the frame number decreases. If you want the frame count to remain the same you have to increase the frame count by the same amount. I use the Loop command for that purpose.
    Quote Quote  
  4. Member
    Join Date
    Apr 2017
    Location
    Within the Oort Cloud
    Search Comp PM
    Whoa. You people answer quickly!

    @sneaker: I'm working this out but how does a combination of fade and dissolve "increase" the total count from 822 to 1368? That's a (non-linear?) increase of nearly 60% in frame count. I will read the manual.

    @manono: Thanks for your pointers. I have no experience with avs Loop commands. Could you share a snippet?

    Thanks to you both. Really helps.
    Quote Quote  
  5. Originally Posted by EasyFeet View Post
    @sneaker: I'm working this out but how does a combination of fade and dissolve "increase" the total count from 822 to 1368? That's a (non-linear?) increase of nearly 60% in frame count. I will read the manual.
    You used v3, v9 and v10 twice each.
    Quote Quote  
  6. Member
    Join Date
    Apr 2017
    Location
    Within the Oort Cloud
    Search Comp PM
    Nope. Not understanding. Have poked a stick at the code. Where am I using them twice?

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    
    v1=ImageReader("1.png", fps=24).trim(1,106)
    v3=ImageReader("3.png", fps=24).trim(1,471)
    v9=ImageReader("9.png", fps=24).trim(1,58)
    v10=ImageReader("10.png", fps=24).trim(1,35)
    v11=ImageReader("11.png", fps=24).trim(1,152)
    
    d1 = Dissolve(v1, v3, 5)
    d3 = Dissolve(v3, v9, 5)
    d9 = Dissolve(v9, v10, 5)
    d10 = Dissolve(v10, v11, 5)
    
    vid = d1 + d3 + d9 + d10
    
    fadeOut(fadeIn(vid,60),60)
    Quote Quote  
  7. Member
    Join Date
    Apr 2017
    Location
    Within the Oort Cloud
    Search Comp PM
    @sneaker: I think you are giving me detailed hints but I do not grok this.

    v3, v9 and v10 are used twice in the dissolve set of commands.

    Are cumulative dissolves disrupting the frame count?
    Quote Quote  
  8. x = Dissolve(a, b, 5)
    creates a new clip x as a combination of clip a and b.

    Then
    y = Dissolve(b, c, 5)
    creates a new clip y as a combination of clip b and c.

    So now you have used clip b twice. It is in clip x and clip y. If you then
    x ++ y
    it will have clip a once, clip b twice and clip c once.

    Total length: [length of a] + [length of b] - 5 + [length of b] + [length of c] - 5
    Quote Quote  
  9. Member
    Join Date
    Apr 2017
    Location
    Within the Oort Cloud
    Search Comp PM


    @sneaker: You are way more difficult to understand than this guy. But way more helpful. And you type faster.

    Code:
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\VSFilter.dll")
    
    v1=ImageReader("1.png", fps=24).trim(1,106)
    v3=ImageReader("3.png", fps=24).trim(1,471)
    v9=ImageReader("9.png", fps=24).trim(1,58)
    v10=ImageReader("10.png", fps=24).trim(1,35)
    v11=ImageReader("11.png", fps=24).trim(1,152)
    
    d1 = Dissolve(v1, v3, 5)
    d3 = Dissolve(d1, v9, 5)
    d9 = Dissolve(d3, v10, 5)
    d10 = Dissolve(d9, v11, 5)
    
    fadeOut(fadeIn(d10,60),60)
    804 frames in Vdub. Getting closer. Thankyou.
    Quote Quote  
  10. One additional note since I see you using Trim(1, xxx) but don't know if you do that on purpose or by accident: Trim() and most other AviSynth filters start counting frames at 0. So Trim(1, xxx) will skip the first frame. And for some filters the end frame/last frame can be inclusive while they are exclusive for others. Always look into the respective documentation.
    Quote Quote  
  11. Member
    Join Date
    Apr 2017
    Location
    Within the Oort Cloud
    Search Comp PM
    I can't thank you enough sneaker. You have illuminated a path through a difficult conundrum. Cheers.

    Mostly it is by accident.
    Quote Quote  
  12. Originally Posted by EasyFeet View Post
    @manono: Thanks for your pointers. I have no experience with avs Loop commands. Could you share a snippet?
    I use it for film credit dissolves. These are text screens where there's no movement the way there might be if you're dissolving live action. Nor am I dissolving any audio because I don't want it dissolved. So, this may or may not be useful for you. Here's an example from a film I worked on recently:

    X=Last
    A=X.Trim(0,718)###Separate out the first 718 frames
    A=A.Loop(41,718,718)###Create 40 new duplicate copies of frame 718
    B=X.Trim(718,0)###Separate out the rest of the movie (creating yet another copy of frame 718, the 41st dupe frame)
    Dissolve(A,B,41)###Dissolve over same number as duplicate frames created


    The total frame count after is the same as before I started. This may seem a little screwy but I often do a whole lot of these things, there being many credit text screens, and by rigging up a way to 'reuse' the same frame number 4 different times (and the same dissolve number twice), I have less chance of getting confused and having to launch into half an hour's worth of work trying to figure out where I messed up.

    Before doing this I've Freezeframed (or sometimes replaced) all of the different text screens, in the process doing away with the original dissolves.
    Quote Quote  
  13. Member
    Join Date
    Apr 2017
    Location
    Within the Oort Cloud
    Search Comp PM
    Sorry for the late reply. Thanks @manono for your code and @sneaker for your guidances. Cheers.
    Quote Quote  



Similar Threads