VideoHelp Forum

+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Member
    Join Date
    Jan 2013
    Location
    Florida
    Search Comp PM
    I have been tying different depan/stabilize settings trying to get a more substantial smoothing out of my video. I realize that this will come at the cost of losing correspondingly more picture area as the crop becomes larger, which I can live with, up to a point.

    I achieved good results using Deshaker, but I am trying to keep my workflow as uncluttered as possible, so I'm using depan in Avisynth (avisynth is part of my flow) and trying to get somewhat close to the results I achieved with Deshaker. I realize it probably won't get the same results, I'm just trying to get closer.

    I'm using a slight variation of John Meyers (Based on VideoFreds) restoration script. It is really improving many aspects of my scanned footage, I'm just trying to tweak this aspect, the motion smoothness.

    I have tried different settings for the maxstab values, (up and down) as well as the selections for the "method" (I tried 0 and 2, also). I even played with the crop and contast values, just to see what would happen.

    I'm guessing it is a correct mix of a couple of these variables that will get me closer to where I want to be, it's just that I haven't hit on the right combination as of yet.

    Or it might be something I am totally missing.

    Here are the parameters from the script that I started with:

    Code:
    maxstabH=10                                                                       #maximum values for the stabiliser (in pixels) 20 is a good start value 
    maxstabV=10
    est_left=40  est_top=40  est_right=40  est_bottom=40        #crop and contast values for special Estimate clip
    est_cont=1.6
    and the function:

    Code:
    stab_reference= cropped_source.crop(est_left,est_top,-est_right,-est_bottom).tweak(cont=est_cont).MT_binarize(threshold=80).greyscale().invert()
    mdata=DePanEstimate(stab_reference,trust=1.0,dxmax=maxstabH,dymax=maxstabV)
    
    #Deflicker may change colors !!
    stab=DePanStabilize(cropped_source,data=mdata,cutoff=0.5,dxmax=maxstabH,dymax=maxstabV,method=1,mirror=15).deflicker()
    #stab=DePanStabilize(cropped_source,data=mdata,cutoff=0.5,dxmax=maxstabH,dymax=maxstabV,method=1,mirror=15)
    I read the avisynth wiki on this function, as well as 15 pages of posts over at doom9, but there really wasn't anything in either that said: "in order to make the effect greater/lesser, you need to adjust......"

    If anyone out there more fluent in the settings of this plugin has a suggestion as to what variable(s) I should tweak, and in which direction, in order to make the smoothing effect greater, I would really appreciate the nudge.

    Thank you
    Last edited by Bruce/Fl; 18th Apr 2016 at 03:21.
    Quote Quote  
  2. Learner
    Join Date
    Jan 2015
    Location
    soton
    Search Comp PM
    Hi Bruce/Fl , here is link to documentary of Depan/DepanEstimate which explain the function order http://avisynth.org.ru/depan/depan.html . hope it helps you .
    Quote Quote  
  3. BGbdd's link is the key: there are all sorts of Depan parameters you can set which are not being used in the script you are using. You play around with these. Add them to the DePanStabilize call and try setting something other than the default numbers. When I adapted VideoFred's script, all I wanted Depan to do was remove gate weave, which it does extremely well, so I never bothered to play around with all of its other settings.

    For bigger motion, I use Deshaker or, better yet, Mercalli. I do that outside the script. Mercalli is pure magic, IMHO.
    Quote Quote  
  4. Member
    Join Date
    Jan 2013
    Location
    Florida
    Search Comp PM
    Thank you both for the replies.

    I saw the documentation page, which is where I saw the options for "method", but I didn't think to look at other variables that could be used also. I just assumed (we know how that usually goes) that the best ones were being utilized. In a sense they were, for your purposes, but my goals are different. Bad assumption on my part.

    John, I will try plugging some of them in to see what they do, if I can get the corresponding data loaded also (like where you use dymax in the "function" section, but define it earlier in the "parameters" section.) Not being as well versed in Avisynth as most, this is challenging for me.

    I did have a different thought while I was looking around for any guides on this last night.

    I saw mention of a script that you developed for using deshaker inside of Vegas. I know deshaker does what I need, but I ruled it out as I was trying to reduce my workflow to a minimum. If you remember, I was contemplating some variation of Vegas, deshaker/Vdub, Avisynth, and back to Vegas. That plan has now been reduced to simply Vegas -> Avisynth-> out to 264. I would do the motion compensation with depan in the Avisynth script.

    With that in mind, doing some deshaking in Vegas fits this plan nicely. It keeps it just Vegas -> Avisynth. I'm fluent enough with deshaker, much more than depan. Does your script/Vegas tweak still work? Have you utilized it lately? If this is a good option is there a place where I can get the information on this? I saw some (now dead) links in various places last night, like the Sonycreative forums, but they were probably over 10 years old, IIRC.

    Thank you.
    Quote Quote  
  5. Don't try to get fancy in trying update the function calls. Instead, simply "hardwire" the settings inside of that one DepanStabilize call. For instance, here is that one line, but with some of the additional parameters added. The numbers I have used for each parameter are the defaults. Therefore you should try this line in your script and make sure I didn't screw anything up. As written, it should give you identical results to what you are already getting. Then, start playing around with the various settings.

    Code:
    stab=DePanStabilize(cropped_source,data=mdata,cutoff=0.5,dxmax=maxstabH,dymax=maxstabV,method=1,mirror=15,cutoff=1,damping=1,prev=0,next=0,blur=0).deflicker()
    Quote Quote  
  6. Member
    Join Date
    Jan 2013
    Location
    Florida
    Search Comp PM
    Thank you John, I'll try some different settings with that tonight when I have my computer in front of me.
    Quote Quote  
  7. Member
    Join Date
    Jan 2013
    Location
    Florida
    Search Comp PM
    John, I tried a variety of settings last night. (The line you gave me to insert instead, and told me to check, had an issue, two "cutoff" statements, but I just eliminated one and it was good to go). I also added some variables like initzoom and addzoom, and tried different values for those along with still trying different values on the other variables. The only differeces I have been able to indudce were all bad, the motion became more exagerrated. If something I did made it worse, (like say make a value bigger), I then did the opposite to see if would have the opposite effect, but all that seemed to do was get it back to normal, ie, no corrections to the original file.

    I'm still going to try a few things, but if I don't have any luck, could I upload a small clip that has some typical hand-held shaking motion for you to plug in your script (which is the same as mine, only with different final size (1920x1080) and corresponding temp border crop numbers(240)) for you to take a shot at? That is of course only if you have some spare time.

    As I said, I'm still trying, I just noticed I have overlooked a "range" statement for depan estimate. I'm adding it in now to see what happens.
    Last edited by Bruce/Fl; 15th Apr 2016 at 12:36. Reason: More detail added to first paragraph.
    Quote Quote  
  8. Member
    Join Date
    Jan 2013
    Location
    Florida
    Search Comp PM
    Over the past few days i've tried more combinations of the different variables, but to no avail. I'm really at a stopping point. Every time I hit upon something that gives a different result, that result is an even worse result.

    I'm presently trying VideoFreds version, just to see what it'll do, but even with my very, VERY elementary understanding of reading avisynth, it doesn't look like there is much different in it, as far as the internal function instructions go.

    I'm really surprised at the lack of other discussions online about what kind of settings would give depan motion compensation a result strong enough to handle some hand-held camera shake, but everything I've come across in my searching seems to only tackle very subtle shakes/vibrations, like the afore mentioned gate weave and similar.

    I've tried to keep my workflow to just Vegas -> avisynth, but it looks like I might have to add deshaker/VDud back into it as well, if I can't get these variables figured out.
    Quote Quote  
  9. I'm surprised you don't get better results. If I set the stabilize parameters at 20, and use my version of the script, which you already have, it does a pretty good job eliminating a lot of camera motion.

    This clip is something I usually show to illustrate the dirt removal I have developed for Polaroid's instant movie film (Polavision), but it also shows the kind of stabilization I am able to get, just using the script you already have:

    https://www.youtube.com/watch?v=ud1XNIoh1P8
    Quote Quote  
  10. Originally Posted by johnmeyer View Post
    This clip is something I usually show to illustrate the dirt removal I have developed for Polaroid's instant movie film (Polavision), but it also shows the kind of stabilization I am able to get, just using the script you already have:

    https://www.youtube.com/watch?v=ud1XNIoh1P8
    That's not much shaking. I suspect Bruce/Fl has much more shaking than that. I've found that depan doesn't work with very shaky material -- like that water skying video that was posted a while back. VirtualDub's deshaker is much better with severe shaking. Of course, you get all the usual problems like bad edge filling and motion blur.
    Quote Quote  
  11. Member
    Join Date
    Jan 2013
    Location
    Florida
    Search Comp PM
    Actually that is pretty representative of the shakiness I am seeing.

    John, is that the only adjustment you made, changing both the maxstabH and the maxstabV to 20? I'm sure I tried that as a stand alone adjustment to your script, I must have something else wrong somewhere possibly. Because that kind of a correction is something I'd be very happy with.

    Did you have to tweak any other settings because of the greater latitude you're giving the command? The "zoom" factor (larger crops to ensure the edges are good) would have to be correspondingly larger, correct?

    I adjusted the "in_bord_left" and "in_bord_left" to 240*, due to my source file being pillarboxed 1920x1080, as opposed to your 720x480 based numbers in your script, do I need to make any other adjustments due to my file size, in regards to the parameters used by depan?

    *I'm pretty sure I first ran your script and left them at 0, but when I looked at the results I had the "moving borders" effect big time. Once I changed it to 240 that eliminated it.

    Thank you.

    (I'm away from my computer for about the next hour or so, but depending on your reply, I'm going to try it again on a different section of the file. I'm wondering if maybe the problem might possibly have something to do with my test clip, it has some moderate movement right off the bat, maybe there isn't enough of a "sample size", at that early point for depan to get a good reading on? I only cut out about a 5 second portion so that I could process them quickly as I tried various settings, maybe a better sample might show a more representative rendering of any improvements made)
    Quote Quote  
  12. It is the stock script that I've already given you, with no changes to the stabilization code. I just set both the hor/ver stab to 20 (actually it may have been less than that, because I usually use only 10).
    Quote Quote  
  13. Member
    Join Date
    Jan 2013
    Location
    Florida
    Search Comp PM
    Thank you John.

    I went and cut out a different section of one of my files. That made all the difference. It gets results similar to the example that you posted.

    I can only guess that the small section that I selected with the shakiness right at the beginning was particularly troublesome, and too short for me to get a fair idea of the results it could give.

    Wow, glad that hurdle is behind me!! Thank you again!
    Quote Quote  



Similar Threads