View Single Post
Old 8th February 2020, 06:37   #96  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
or is it something you've specifically had to configure?
This is it
Code:
    if(debug) {
        dprintf("Crop(ModW/H):  X =%3d   Y =%3d   W =%3d(%d)   H =%3d(%d)",
            crop_x,crop_y,crop_w,crop_x+crop_w-w,crop_h,crop_y+crop_h-h);
        dprintf("Input: Width=%d Height=%d",w,h);
        dprintf("Crop(%d,%d,%d,%d)",crop_x,crop_y,crop_w,crop_h);
        dprintf("Crop(%d,%d,%d,%d)",crop_x,crop_y,crop_x+crop_w-w,crop_y+crop_h-h);    // debug output
        if(isplanar && crop_w % 4)
            dprintf("*** WARNING *** Some players and VDubMod may require WMod=4");
        double duration =  (double(clock()) / double(CLOCKS_PER_SEC)) - start_time;
        dprintf("Constructor Scan Total Time=%.3f secs",duration);
    }
    if(prefix !="") {
        const char *p;
        int pfixlen=int(strlen(prefix));
        if(pfixlen>128)
            pfixlen=128;
        char bf[128+32];
        memcpy(bf,prefix,pfixlen);
        char *d;
        AVSValue var;

        d=bf+pfixlen;
        for(p="X";*d++=*p++;);          // strcat variable name part
        var  =  GetVar(env,bf);
        env->SetVar(var.Defined()?bf:env->SaveString(bf),crop_x);

        d=bf+pfixlen;
        for(p="Y";*d++=*p++;);          // strcat variable name part
        var  =  GetVar(env,bf);
        env->SetVar(var.Defined()?bf:env->SaveString(bf),crop_y);

        d=bf+pfixlen;
        for(p="W";*d++=*p++;);          // strcat variable name part
        var  =  GetVar(env,bf);
        env->SetVar(var.Defined()?bf:env->SaveString(bf),crop_w);

        d=bf+pfixlen;
        for(p="H";*d++=*p++;);          // strcat variable name part
        var  =  GetVar(env,bf);
        env->SetVar(var.Defined()?bf:env->SaveString(bf),crop_h);

        d=bf+pfixlen;
        for(p="W2";*d++=*p++;);         // strcat variable name part
        var  =  GetVar(env,bf);
        env->SetVar(var.Defined()?bf:env->SaveString(bf),crop_x+crop_w-w);

        d=bf+pfixlen;
        for(p="H2";*d++=*p++;);         // strcat variable name part
        var  =  GetVar(env,bf);
        env->SetVar(var.Defined()?bf:env->SaveString(bf),crop_y+crop_h-h);
    }
I did not bother to check for valid Prefix variable name, so if you provide something like "a!35434342123:'^%$", I've no idea if it will go BANG!!!.
Dont think I've ever seen anybody else check valid var name, I did it in one plug but forgot which one.

RoboCrop scans from start to end of video clip, Samples number of frames [default 40], spread evenly throughout the clip.
Is your source filter Indexing the thing, if so then that is where the pause is. [I usually use it with Ut_Video AVI, where it takes maybe less than 1.0 sec for 2 hr Movie].
LSMashVideoSource source does not index, although I dont know how well it does where seeking in big jumps through the video clip.
RoboCrop tries to get the OutMost borders, so if borders change will try to find the least crop borders.

"Usage" looked a bit hard"
I usually just call as RoboCrop(), is intended to be mostly autonomous. [might want to set WMod, HMod, and Laced].

Quote:
If I reduce Samples to 1
Not a terribly good idea, dark single frame like the prev Cabaret frame might chop up your clip. [just as Autocrop with default settings of 5 samples frames (as I posted in Cabaret post)]
Quote:
Originally Posted by StainlessS View Post
EDIT: AutoCrop() fails badly [with defaults] on a 10 mins clip surrounding above frame from Cabaret. [chops off half of frame, not much image left]
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 8th February 2020 at 06:48.
StainlessS is offline   Reply With Quote