VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or buy Replay Video Capture or PlayON and record Netflix, HBO, etc! :)
+ Reply to Thread
Results 1 to 30 of 30
Thread
  1. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    I'm trying to create an AviSynth script that replaces one shot in a video using two images.

    Is it possible to overlay one image over a second one, and gradually fade the top one out so that the one underneath slowly appears?
    If so, does anyone have a script example or tutorial I could take a look at?
    Quote Quote  
  2. Probably easier to use dissolve() to get the same effect . It's basically a crossfade what you're describing how one image fades into the next
    http://avisynth.nl/index.php/Dissolve

    Unless you need to use overlay() for some specific reason ?

    In that case one way to do it is to use a mask and animate() the opacity of the mask over time e.g .using levels(). (Mask opacity white to black controls the fade and overlay operation) . The other way is to animate() the overlay() opacity over time)
    Quote Quote  
  3. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Thanks! I think Dissolve is exactly what I need. I've almost got it working right. The problem I'm having is that there are two dissolves instead of one. The first image is dissolving in, which I don't want. How do I remove that dissolve, but not the one between the two images?

    Here's my script:

    Code:
    LoadPlugin("C:\DVD\DGDecode.dll")
    clip1 = MPEG2Source("C:\DVD\04\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\DVD\24\VTS_01_1.d2v")
    ovl3 = ImageSource("C:\Images\1.png", fps=clip1.framerate)
    ovl4 = ImageSource("C:\Images\2.png", fps=clip1.framerate)
    ovl3 = ovl3.ConvertToYV12()
    ovl4 = ovl4.ConvertToYV12()
    clip2.Trim(28,2714)FadeOut(19) + clip1.Trim(2688,11277) + clip1.Trim(11278,11549).Dissolve(ovl3, ovl4, 271) + clip1.Trim(11550,0)
    Quote Quote  
  4. Did you want a hard cut from clip1 to ovl3? You probably wanted +Dissolve, not .Dissolve
    Quote Quote  
  5. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Thanks! I do want +Dissolve, but I'm having problems with timing the cuts. The images are displaying for a long time before and after the dissolve begins and ends.

    How do I make the dissolve begin as soon as the first image appears, and end as soon as the second image disappears?
    Quote Quote  
  6. Originally Posted by lomaidala View Post
    Thanks! I do want +Dissolve, but I'm having problems with timing the cuts. The images are displaying for a long time before and after the dissolve begins and ends.
    When you debug something, strip everything out and look at it individually. It's the same for checking filters, you remove them one by one and check

    Probably you didn't account for the default length of imagesource(), because you didn't enter any values. Default length is 1000 frames.

    What do you think this is supposed to do? How long do you think it should be?
    Code:
    Dissolve(ovl3, ovl4, 271)
    If it's too long, edit the ovl3 and ovl4 lengths either by filling in the start/end parameters, or using Trim()

    It's not clear what you want to do. Is clip1 going from 11278 to 11549. Did you want the end of that to cross dissolve into ovl3 ? Or is clip1 a hard cut into ovl3 which begins abruptly ?

    If you wanted 2 dissolves - 1) end of clip 1 into ovl3, 2) end ovl3 into ovl4, then include them in dissolve() . You can think of it is
    Dissolve(A,B,C, 271) , where the cross dissolve occurs between A and B, B and C.

    Code:
    Dissolve(clip1.Trim(11278,11549), ovl3, ovl4, 271)
    I suspect you have to adjust ovl3 and ovl4 length because of the default 1000 frames of ImageSource(). (~33 seconds long each for a 30FPS project, minus the transition overlap length)
    Quote Quote  
  7. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Probably you didn't account for the default length of imagesource(), because you didn't enter any values. Default length is 1000 frames.
    That's exactly what I did wrong. Thank you!

    Originally Posted by poisondeathray View Post
    It's not clear what you want to do. Is clip1 going from 11278 to 11549. Did you want the end of that to cross dissolve into ovl3 ? Or is clip1 a hard cut into ovl3 which begins abruptly ?
    11278 to 11549 was supposed to specify the frames over which the image replacements would be applied, and also the frames over which the dissolve would take place. Adding that in was the other part I was doing wrong.

    clip 1 was supposed to hard cut into ovl3.
    ovl3 was supposed to dissolve into ovl4.
    ovl4 was supposed to hard cut into the next part of clip 1.

    Everything works perfectly now! Thank you. Here's the script I came up:

    Code:
    LoadPlugin("C:\DVD\DGDecode.dll")
    clip1 = MPEG2Source("C:\DVD\04\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\DVD\24\VTS_01_1.d2v")
    ovl3 = ImageSource("C:\Images\04\1.png", start=0, end=270, fps=clip1.framerate)
    ovl4 = ImageSource("C:\Images\04\2.png", start=0, end=270, fps=clip1.framerate)
    ovl3 = ovl3.ConvertToYV12()
    ovl4 = ovl4.ConvertToYV12()
    clip2.Trim(28,2714)FadeOut(19) + clip1.Trim(2688,11277) + Dissolve(ovl3, ovl4, 270) + clip1.Trim(11550,0)
    Quote Quote  
  8. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Actually it turns out I am having an issue. At first I thought it was because I set QTGMC to the Draft preset, but now that it's on Placebo, I'm still seeing the same effect:

    Parts of the replacement images looks as though they are bouncing up and down by about a pixel or two. And I only see this effect in the final video, no in VirtualDub. Is there something I did wrong in my script? Same script as above.
    Quote Quote  
  9. Originally Posted by lomaidala View Post
    Actually it turns out I am having an issue. At first I thought it was because I set QTGMC to the Draft preset, but now that it's on Placebo, I'm still seeing the same effect:

    Parts of the replacement images looks as though they are bouncing up and down by about a pixel or two. And I only see this effect in the final video, no in VirtualDub. Is there something I did wrong in my script? Same script as above.
    You're going to have to provide more info, there are some inconsistencies in your description

    You say it's the same script , but mention QTGMC, but there is no QTGMC in the script

    Was source interlaced, or telecined ? I'm assuming interlaced because you're using QTGMC.

    If the problem isn't visible in the vdub preview, that suggests it's an encoding problem. So what encoder, what settings did you use? , or a playback configuration issue
    Last edited by poisondeathray; 17th Sep 2015 at 13:20.
    Quote Quote  
  10. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Sorry about that, I wrongly assumed those parts of the script weren't relevant. I believe the source is interlaced. There are normally broken horizontal lines in the video, as well as some pixelated edges. QTGMC gets rid of both for me, greatly improving the video quality. I use Xvid (see attachment for complete settings). Here's the complete script:

    Code:
    LoadPlugin("C:\DVD\DGDecode.dll")
    clip1 = MPEG2Source("C:\DVD\04\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\DVD\24\VTS_01_1.d2v")
    ovl3 = ImageSource("C:\Images\04\1.png", start=0, end=270, fps=clip1.framerate)
    ovl4 = ImageSource("C:\Images\04\2.png", start=0, end=270, fps=clip1.framerate)
    ovl3 = ovl3.ConvertToYV12()
    ovl4 = ovl4.ConvertToYV12()
    clip2.Trim(28,2714)FadeOut(19) + clip1.Trim(2688,11277) + Dissolve(ovl3, ovl4, 270) + clip1.Trim(11550,0)
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    QTGMC( Preset="Placebo" )
    Srestore(Frate=23.976)
    Image Attached Files
    Quote Quote  
  11. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    I have two new findings regarding certain areas of the replacement images bouncing up and down during the dissolve:
    1. The dissolve only bounces up and down when both QTGMC and Srestore are used together. If I take either one of them out of the script, the dissolve is smooth.
    2. The dissolve doesn't bounce when the video source is cut into a smaller chunk (I used Mpg2Cut2 to clip a sample, but note that using it to create a clip of the entire video instead only gives me the same bouncy results).

    I also have a correction to make:
    It turns out I do see the dissolve bounce when I preview the video in VirtualDub before processing.

    Here's my current script:
    Code:
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v")
    ovl3 = ImageSource("C:\Images\04\3.png", start=0, end=270, fps=clip1.framerate)
    ovl4 = ImageSource("C:\Images\04\4.png", start=0, end=270, fps=clip1.framerate)
    ovl3 = ovl3.ConvertToYV12
    ovl4 = ovl4.ConvertToYV12
    clip1.Trim(2689,11277) + Dissolve(ovl3, ovl4, 270) + clip1.Trim(11550,0)
    QTGMC( Preset="Placebo" )
    Srestore(Frate=23.976)
    Does anyone know how to get a smooth dissolve from one image to the other?
    Video source:
    It's encoded interlaced and has interlaced frames, and there's field blending.

    Software:
    VirtualDub-1.10.4
    AviSynth 2.5
    Xvid
    DGIndex
    DVDFab HD Decrypter

    Specs:
    Windows 7 Professional, 64-bit
    AMD Phenom(tm) II X6 1090T Processor 3.21 GHz
    AMD 6870
    AMD 6850
    8.00 GB RAM
    Quote Quote  
  12. Try running QTGMC and SRestore on the interlaced clip before adding/dissolving the stills. Of course, that means all your frame numbers have to change.
    Quote Quote  
  13. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    Try running QTGMC and SRestore on the interlaced clip before adding/dissolving the stills.
    That gives me the following error on the line with QTMGC:

    VirtualDub Error
    Avisynth open failure:
    Script error: Invalid arguments to function "QTMGC"
    Quote Quote  
  14. Originally Posted by lomaidala View Post
    Originally Posted by jagabo View Post
    Try running QTGMC and SRestore on the interlaced clip before adding/dissolving the stills.
    That gives me the following error on the line with QTMGC:

    VirtualDub Error
    Avisynth open failure:
    Script error: Invalid arguments to function "QTMGC"
    Did you specify a video for QTGMC to deinterlace?

    This won't work:

    Code:
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v")
    QTGMC( Preset="Placebo" )
    ...
    This will:

    Code:
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v").QTGMC( Preset="Placebo" )
    ...
    Or this:

    Code:
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v")
    clip1 = clip1.QTGMC( Preset="Placebo" )
    ...
    Or this:

    Code:
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v")
    clip1 = QTGMC( clip1, Preset="Placebo" )
    ...
    Quote Quote  
  15. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Thank you, jagabo! The dissolve is now smooth. Running QTGMC and Srestore before adding and dissolving the stills works.

    Thank you very much for breaking down the options like that. I've read about this stuff, but it's much more clear to see the examples applied to what I'm more familiar with. Your example of what doesn't work is exactly what I did wrong.

    One thing though: how do I apply Srestore to more than one video source when I'm doing it in the middle of the script like this instead of at the end? I've done a lot of reading and experiments and can't come up with anything functional. There's something about the grammar or operators I'm just not getting.
    Quote Quote  
  16. Most filters take an input video and produce an output video:

    Code:
    output = filter(input)
    If you don't specify a named video the name "last" is used. So a script like:

    Code:
    Mpeg2Source("filename.d2v")
    QTGMC()
    SRestore()
    is really saying:

    Code:
    last = Mpeg2Source("filename.d2v")
    last = QTGMC(last)
    last = SRestore(last)
    Mpeg2Source creates a video called last. QTMGC takes last from Mpeg2Source and creates a new video called last. SRestore takes last from QTGMC and creates a new video called last. Finally, assuming that is the end of your script, last from SRestore is returned to the editor/encoder.

    Using a "." between two filters on the same line pipes the output of the filter on the left directly to the filter on the right, without creating a named stream.

    Code:
    clip1 = Mpeg2Source("filename.d2v").QTGMC().SRestore()
    In that example a stream called clip1 is created from the three filters without creating a stream called last. If that was your entire script it would fail because the implied return(last) at the end will not be able to find "last".

    Be careful when piping, clip parameters are not available. For example:

    Code:
    Mpeg2Source("filename.d2v")
    BilinearResize(width/2, height/2)
    This script works and produces a clip that's half the width and half the height of the source. It is the equivalent of:

    Code:
    last = Mpeg2Source("filename.d2v")
    last = BilinearResize(last, last.width/2, last.height/2)
    But this script will not work:

    Code:
    Mpeg2Source("filename.d2v").BilinearResize(width/2, height/2)
    because "width" is assumed to be "last.width" but last has not been defined yet (similarly for "height"). Even if you name the clip:

    Code:
    clip1 = Mpeg2Source("filename.d2v").BilinearResize(clip1, clip1.width/2, clip1.height/2)
    it will not work because clip1 isn't defined until after the two filters have executed.

    If you have different clips that need different handling the best thing to do is to use explicit names and pipes:

    Code:
    clip1 = Mpeg2Source("30fps.d2v") # a field blended PAL to NTSC conversion
    clpi2 = Mpeg2Source("25 fps.d2v) # a 25p PAL video
    
    clip1 = clip1.QTGMC().SRestore(frate=25.0) # convert clip1 to 25 fps
    
    clip1+clip2 # append clip1 and clip2, both now 25 fps, and implied return(last)
    Quote Quote  
  17. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Thank you for that thorough explanation.

    Originally Posted by jagabo View Post
    If you have different clips that need different handling the best thing to do is to use explicit names and pipes:

    Code:
    clip1 = Mpeg2Source("30fps.d2v") # a field blended PAL to NTSC conversion
    clpi2 = Mpeg2Source("25 fps.d2v) # a 25p PAL video
    
    clip1 = clip1.QTGMC().SRestore(frate=25.0) # convert clip1 to 25 fps
    
    clip1+clip2 # append clip1 and clip2, both now 25 fps, and implied return(last)
    But with this example, Srestore is only applied to one of the two sources, correct? What would your example be if clip2 were also 30fps?
    Quote Quote  
  18. The point of that example was to show different handling of two clips. If the second clip requires the same handling then apply the same QGMGC and SRestore it too. In the example the two videos are simply appended so you are going to use QGTGMC.SRestore on both you could append them first.

    Code:
    clip1 = Mpeg2Source("30fps1.d2v")
    clip2 = Mpeg2Source("30pfs2.d2v")
    
    clip1+clip2
    QTGMC().SRestore(frate=25.0) # convert them to 25 fps
    Quote Quote  
  19. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    Code:
    clip1 = Mpeg2Source("30fps1.d2v")
    clip2 = Mpeg2Source("30pfs2.d2v")
    
    clip1+clip2
    QTGMC().SRestore(frate=25.0) # convert them to 25 fps
    Thanks again, but the result I'm getting using this method is that Srestore and QTGMC are not applied to either video source (according to what I see in Vdub). Everything else appears to be functioning. Here's my current script:

    Code:
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\24\VTS_01_1.d2v")
    clip1+clip2
    QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    ovl3 = ImageSource("C:\Images\04\3.png", start=0, end=216, fps=clip1.framerate)
    ovl4 = ImageSource("C:\Images\04\4.png", start=0, end=216, fps=clip1.framerate)
    ovl3 = ovl3.ConvertToYV12
    ovl4 = ovl4.ConvertToYV12
    clip2.Trim(23,2268).FadeOut0(16) + \
    clip1.Trim(2690,11277) + \
    Dissolve(ovl3, ovl4, 216) + \
    clip1.Trim(11550,0)
    Quote Quote  
  20. Think: What does clip1+clip2 do? What is the name of the resulting clip? Is it appropriate to do this in the context of the rest of your script?
    Quote Quote  
  21. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    clip1+clip2 appends clip1 and clip2 together, the name of the resulting clip is last...and I'm guessing it's not appropriate to do this in the context of the rest of my script, based on your reply, but I'm completely lost as to what would work.

    Can you give me another clue?
    Quote Quote  
  22. Originally Posted by lomaidala View Post
    clip1+clip2 appends clip1 and clip2 together, the name of the resulting clip is last...
    What happens to that "last" later in your script?
    Quote Quote  
  23. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by lomaidala View Post
    clip1+clip2 appends clip1 and clip2 together, the name of the resulting clip is last...
    What happens to that "last" later in your script?
    It gets chopped up and hit with the fadeout and dissolve filters I've specified. I'm afraid I don't follow your clue...may I have another?
    Quote Quote  
  24. Originally Posted by lomaidala View Post
    Originally Posted by jagabo View Post
    Originally Posted by lomaidala View Post
    clip1+clip2 appends clip1 and clip2 together, the name of the resulting clip is last...
    What happens to that "last" later in your script?
    It gets chopped up and hit with the fadeout and dissolve filters I've specified.
    No. Let's rearrange your clip a bit for clarity:

    Code:
    # first load all the external dependencies
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    
    
    # then load all the source clips
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\24\VTS_01_1.d2v")
    ovl3 = ImageSource("C:\Images\04\3.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    ovl4 = ImageSource("C:\Images\04\4.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    
    # then join clip1 and clip2 and QTGMC/Srestore them to 23.976 fps
    clip1+clip2
    QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    
    
    # last is now your 23.976 clip
    # clip1, clip2, ovl3 and ovl4 are unchanged <--- HINT
    
    clip2.Trim(23,2268).FadeOut0(16) + clip1.Trim(2690,11277) + Dissolve(ovl3, ovl4, 216) + clip1.Trim(11550,0)
    What happens on the last line?
    Last edited by jagabo; 13th Mar 2018 at 18:29.
    Quote Quote  
  25. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    Code:
    # first load all the external dependencies
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    
    
    # then load all the source clips
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\24\VTS_01_1.d2v")
    ovl3 = ImageSource("C:\Images\04\3.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    ovl4 = ImageSource("C:\Images\04\4.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    
    # then join clip1 and clip2 and QTGMC/Srestore them to 23.976 fps
    clip1+clip2
    QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    
    
    # last is now your 23.976 clip
    # clip1, clip2, ovl3 and ovl4 are unchanged <--- HINT
    
    clip2.Trim(23,2268).FadeOut0(16) + clip1.Trim(2690,11277) + Dissolve(ovl3, ovl4, 216) + clip1.Trim(11550,0)
    What happens on the last line?
    A new last is created, and the last from clip1+clip2 with QTGMC/Srestore is scrapped. Right?
    Quote Quote  
  26. Yes, exactly. So what you want is something like:

    Code:
    # first load all the external dependencies
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    
    
    # then load all the source clips
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    clip2 = MPEG2Source("C:\24\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    ovl3 = ImageSource("C:\Images\04\3.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    ovl4 = ImageSource("C:\Images\04\4.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    
    # finally join the clips with all the effects
    clip2.Trim(23,2268).FadeOut0(16) + clip1.Trim(2690,11277) + Dissolve(ovl3, ovl4, 216) + clip1.Trim(11550,0)
    Remember the frame numbers for the Trim() commands are different than in your earlier script where you ran QTMGC().SRestore() after joining and adding effects.
    Quote Quote  
  27. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    So what you want is something like:

    Code:
    # first load all the external dependencies
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    
    
    # then load all the source clips
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    clip2 = MPEG2Source("C:\24\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    ovl3 = ImageSource("C:\Images\04\3.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    ovl4 = ImageSource("C:\Images\04\4.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    
    # finally join the clips with all the effects
    clip2.Trim(23,2268).FadeOut0(16) + clip1.Trim(2690,11277) + Dissolve(ovl3, ovl4, 216) + clip1.Trim(11550,0)
    I was able to arrive at a similar solution when I asked my question in post #15, and now I'm getting the same result, which is that the script won't load in Vdub. Srestore can only be called once, right? How is it you're able to run such a script?
    Quote Quote  
  28. Originally Posted by lomaidala View Post
    Srestore can only be called once, right? How is it you're able to run such a script?
    Get the latest (2013!) version:
    http://avisynth.nl/images/Srestore_27h.avsi

    # 10/28/2013 martin53
    # - Update v2.7e -> v2.7f
    # Callable more than once from the same script with help of unique global variables per instance.
    Quote Quote  
  29. If you were stuck with a filter tha can only be called once you could use something like:

    Code:
    clip1+clip2
    CallableOnlyOnceFilter()
    clip1=last.Trim(0,N)
    clip2=last.Trim(N+1,0)
    Where N is the last frame of the clip1, N+1 is the first frame of clip2.

    By the way, you can return any of the named clips at any time after the clip has been created within the script. This can be useful for debugging or fine tuning:

    Code:
    # first load all the external dependencies
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    
    
    # then load all the source clips
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    return(clip1)
    clip2 = MPEG2Source("C:\24\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    ovl3 = ImageSource("C:\Images\04\3.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    ovl4 = ImageSource("C:\Images\04\4.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    
    
    # finally join the clips with all the effects
    clip2.Trim(23,2268).FadeOut0(16) + clip1.Trim(2690,11277) + Dissolve(ovl3, ovl4, 216) + clip1.Trim(11550,0)
    Last edited by jagabo; 14th Mar 2018 at 06:53.
    Quote Quote  
  30. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by raffriff42 View Post
    Originally Posted by lomaidala View Post
    Srestore can only be called once, right? How is it you're able to run such a script?
    Get the latest (2013!) version:
    Ah! Thank you. That did it.

    Originally Posted by jagabo View Post
    If you were stuck with a filter tha can only be called once you could use something like:

    Code:
    clip1+clip2
    CallableOnlyOnceFilter()
    clip1=last.Trim(0,N)
    clip2=last.Trim(N+1,0)
    Where N is the last frame of the clip1, N+1 is the first frame of clip2.

    By the way, you can return any of the named clips at any time after the clip has been created within the script. This can be useful for debugging or fine tuning:

    Code:
    # first load all the external dependencies
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    
    
    # then load all the source clips
    clip1 = MPEG2Source("C:\04\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    return(clip1)
    clip2 = MPEG2Source("C:\24\VTS_01_1.d2v").QTGMC( Preset="Placebo" ).Srestore(Frate=23.976)
    ovl3 = ImageSource("C:\Images\04\3.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    ovl4 = ImageSource("C:\Images\04\4.png", start=0, end=216, fps=clip1.framerate).ConvertToYV12() # and convert to YV12
    
    
    # finally join the clips with all the effects
    clip2.Trim(23,2268).FadeOut0(16) + clip1.Trim(2690,11277) + Dissolve(ovl3, ovl4, 216) + clip1.Trim(11550,0)
    Thanks for the tips, and for all your help!
    Quote Quote  



Similar Threads