VideoHelp Forum
+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 35 of 35
Thread
  1. I don't have a long HD source to run your script so I used an SD DVD source with Mpeg2Source(), and upscaled to 1920x1080 after loading. I couldn't find a 64 bit version of Deen() so I had to disable the hqdering() call. Otherwise the script I used is the same as yours. With 32 bit VirtualDub I get an error when opening the script: "Avisynth open failure: DepanEstimate: Allocation Failure!, (Stab.avsi, line 15)..." Using 64 bit AviSynth+ I got no errors and the script ran but it did not stabilize the selected sections. Because...

    But even if the script wasn't crashing for you, it isn't doing what you think it is. You need to put a . between the trim and stab functions. Otherwise the trims won't be piped to stab, each stab will be stabilizing last and producing a new clip called last. And since the result of stab isn't used in the final output stab will not be called at all. After fixing the script (adding a . between each Trim() and Stab()) it still wouldn't run in 32 bit AviSynth (out of memory error). In 64 bit AviSynth+ it ran fine, and stabilized the selected sections.

    In short, you're running out of memory because of too many calls to Depan. A better way to approach this is to use Stab only once, then use ReplaceFramesSimple() to select which frames you want to select from the stabilized video and which you want from the original video:

    Code:
    LoadPlugin("C:\Program Files (x86)\MeGui\tools\dgavcindex\DGAVCDecode.dll")
    AVCSource("C:\Users\User\Desktop\Encoding\IND3\Blu-Ray\00002.dga")
    Colormatrix(mode="rec.709->rec.601", clamp=0, threads=0)
    
    # instead of
    #
    #__film = last
    #__t0 = __film.trim(0, 834)stab()
    #__t1 = __film.trim(835, 3341)
    #__t2 = __film.trim(3342, 8461)stab()
    #__t3 = __film.trim(8462, 11551)
    #__t4 = __film.trim(11552, 21088)stab()
    #
    # use:
    
    stabilized = Stab()
    ReplaceFramesSimple(last, stabilzed, mappings="[0 834] [3342 8461] [11552 21088]")
    # use as many ReplaceFramesSimple() as necessary
    
    crop( 4, 2, -4, -2)
    Spline36Resize(1024,576) # Lanczos (Sharp)
    dehalo_alpha(rx=1.1, ry=1.1, darkstr=0, lowsens=0, highsens=50, ss=1.0)
    hqdering(smoother=deen("c3d",1,3,2,2))
    smoothtweak(brightness=1, dither=-1, interp=0, limiter=true)
    blur(0.02)
    Quote Quote  
  2. I tried cutting this down into 4 parts with 4 separate scripts that each do a about 28 trims a piece and then appending the 4 video parts together after they are finished. That was a way I got this to load without that annoying error.

    It seems that anytime I try to use stab multiple times, the finished video does not stabilize at all. It works fine when I call stab once and use it on the entire thing, but once I try to use stab more than once, or select specific frames, it runs through the encoder fine without the error, but the output video is not stabilized at all.

    EDIT: I guess this was because I forgot to add in the period. I will try it again with the . added in to verify.


    "What about calling it only once and using ReplaceFramesSimple()?"

    I have never heard of or used this before but it sounds like it may be the solution to my problem since it is only using stab once. Would you mind giving me an example of to implement it into my script using the one above? You do not have to go through the trouble of specifying all those trims, I can do that, but at least pick about 10 of them (5 stabilized and 5 not stabilized) and put them into a script for me to add the rest of the trims into it. I should be able to figure it out through either common sense, or trial and error once I have an example to work with.

    EDIT: I guess you included it above. That went right past me.


    Code:
    stabilized = Stab()
    ReplaceFramesSimple(last, stabilzed, mappings="[0 834] [3342 8461] [11552 21088]")
    # use as many ReplaceFramesSimple() as necessary
    When you say use as many ReplaceFramesSimple as necessary, do you mean use it once for all the stabilized frames then use it a second time for all the non stabilized frames? Or is it only able to do so many mappings at a time so I will need to use it more than once in order to cover all of the needed frames?
    Last edited by killerteengohan; 1st Sep 2018 at 16:31.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    But even if the script wasn't crashing for you, it isn't doing what you think it is. You need to put a . between the trim and stab functions. Otherwise the trims won't be piped to stab, each stab will be stabilizing last and producing a new clip called last. And since the result of stab isn't used in the final output stab will not be called at all. After fixing the script (adding a . between each Trim() and Stab()) it still wouldn't run in 32 bit AviSynth (out of memory error). In 64 bit AviSynth+ it ran fine, and stabilized the selected sections.

    In short, you're running out of memory because of too many calls to Depan.
    You are so right, I cannot believe I forgot that period. I have actually never forgot that before when trimming. I can't believe I didn't notice that. Thanks for pointing that out.
    Last edited by killerteengohan; 1st Sep 2018 at 16:32.
    Quote Quote  
  4. Originally Posted by killerteengohan View Post
    Code:
    stabilized = Stab()
    ReplaceFramesSimple(last, stabilzed, mappings="[0 834] [3342 8461] [11552 21088]")
    # use as many ReplaceFramesSimple() as necessary
    When you say use as many ReplaceFramesSimple as necessary, do you mean use it once for all the stabilized frames then use it a second time for all the non stabilized frames? Or is it only able to do so many mappings at a time so I will need to use it more than once in order to cover all of the needed frames?
    I meant you don't have to put all ~55 replacements in one call to ReplaceFramesSimple(). I usually do as many as will fit comfortably in a window while editing (so I can see all of them without having to scroll horizontally). Then use as many calls to it as necessary to replace all the frames I want. For example:

    Code:
    stabilized = Stab()
    ReplaceFramesSimple(last, stabilzed, mappings="[0 834] [3342 8461] [21742, 23979] ] [24112, 25172] [25413, 25462]")
    ReplaceFramesSimple(last, stabilzed, mappings="[25654, 26050] [26134, 26407] [26457, 26532] [26654, 27762] [27799, 27834]")
    # etc.
    Or you could continue to use trims but with only one call to stab:

    Code:
    __film = last
    __stbl = Stab()
    
    __t0 = __stbl.trim(0, 834)
    __t1 = __film.trim(835, 3341)
    __t2 = __stbl.trim(3342, 8461)
    __t3 = __film.trim(8462, 11551)
    __t4 = __stbl.trim(11552, 21088)
    __t5 = __film.trim(21089, 21741)
    __t6 = __stbl.trim(21742, 23979)
    # etc.
    Last edited by jagabo; 1st Sep 2018 at 17:11.
    Quote Quote  
  5. Well I actually used all 55 in one call and it works great. This is actually going to come in handy knowing about this in the rare occasions I get low memory errors and or I cannot call certain things multiple times. If this goes through my encoder just fine, I officially love it!!

    I also thank you for pointing out the way to use it with trims and calling it once. I never knew I could use it like that. That will also come in handy for me if I choose to do that instead. I think I might just go with this method before the other since its a simple paste after MeGui cuts it and adds the trims in.
    Quote Quote  



Similar Threads

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