Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th April 2015, 12:39   #1  |  Link
SilSic
Registered User
 
Join Date: Aug 2012
Posts: 29
How to synchronize two videos by comparing video frames

Hi all,

I need a script which makes it possible to synchronize(video/audio) two videos by comparing video frames which includes cutting the videos to be absolutely identical.
Especially for animes which differs e.g. by eyecatcher commercial break, black transits.

I've been looking for that since so many years but always ended up with no luck which really surprises me, because there are so many people who really need that! Right now search and cut scenes is all I can do but it is a pain in the neck(time-consuming!!!) which I'll never get used to and we are talking about 200 episodes and many others. There is absolutely no software which does that whole process what I'm looking for! But there a few which does have the function like autopano video(Automatic motion-based synchronization of the video frames) but without cut function which means it is absolutely useless. But avisynth seem to be promising.

No concessions, it must be be comparing pictures, to compare two videos by audio doesn't always work out for me.
Even though it is better than nothing.

Help is greatly appreciated!
SilSic
SilSic is offline   Reply With Quote
Old 29th April 2015, 14:54   #2  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,017
You can use StainlessS' scene cutting software to cut into scenes, and then align along scene boundaries.

You say you can't use audio alignment, but you don't really say why that is so. I own and use a program called PluralEyes which lets me align video from multiple cameras which are used to simultaneously film an event, like a ballet performance or sporting event. It aligns using the audio track, and it works amazingly well, and lets me get all the cameras aligned on the timeline in my NLE, with one push of a button. It doesn't get much better than that.

I know dozens of people who use this software and they all love it.

Last edited by johnmeyer; 29th April 2015 at 14:55. Reason: added last sentence
johnmeyer is offline   Reply With Quote
Old 29th April 2015, 15:54   #3  |  Link
SilSic
Registered User
 
Join Date: Aug 2012
Posts: 29
Hey thx for your quick reply.
I don't know how StainlessS works but it seems to be also a headache due of making a lot by hand. The whole process should work automatically of course or there is no sense at all in this!

How should audio alignment work, if the first video is only in english and the second only in japanese??

I tried really anything and I also tried PluralEyes but it doesn't cut the videos to ensure synchronizing for the rest of the video parts and it's only for audio alignment.

I thought about this: MSU Scene Change Detector analyses the video and the differences between the two videos can be determined, another plugin could cut the spots marked as different and another plugin synchronises by knowing these different spots. One video stays always untouched and is used as reference.
I also thought about commercial detector but it can't differ main video from eyecatcher in animes because they're mostly the same as the main video plus the eyecatchers changes every 26 Episodes on and on.

Last edited by SilSic; 29th April 2015 at 16:11.
SilSic is offline   Reply With Quote
Old 29th April 2015, 21:19   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
Can you specify Exactly what is required (anything and everything known about both clips).
Does only one clip have adverts, or both ?, if so, are they in exact same position (although maybe not same length ads in both clips).
Are dimensions, FrameRate etc exactly the same ?
What is an EyeCatcher ? (some kind of advert for another similar film ?)

some links
http://forum.doom9.org/showthread.ph...ne#post1490778
http://forum.doom9.org/showthread.ph...ne#post1186331
http://forum.doom9.org/showthread.ph...ts#post1669306
http://forum.videohelp.com/threads/3...66#post1912566

Using last link for inspiration:-
You could write two files of ranges, one for each clip, for use by SelectFrames.avs (which uses Prune)
to cut and splice both clips separately (including audio).
(I would prefer using GScript for that rather than ScriptClip)

Also Matchframes/LocateFrames might be of use.
__________________
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; 29th April 2015 at 21:27.
StainlessS is offline   Reply With Quote
Old 29th April 2015, 23:07   #5  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 360
http://tvtropes.org/pmwiki/pmwiki.php/Main/EyeCatch
https://www.youtube.com/watch?v=RA6lH7xVGM0&t=0m7s
creaothceann is offline   Reply With Quote
Old 29th April 2015, 23:32   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
Thanx for that creaothceann, think I've seen the "We'll be right back after these messages" type thing on US shows transmitted in the UK.
(They might do similar here on Quiz or Shopping type Channels, but I would not know about that).
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 30th April 2015, 11:19   #7  |  Link
SilSic
Registered User
 
Join Date: Aug 2012
Posts: 29
in that case both clips doesn't have adverts, but dimensions are different, framerate is the same.

The script should work even when one of the both videos differs in framerate, dimension and so on. No matter what it is supposed to synchronize any kind of two videos.

thx creaothceann for the explanation of eyecatch.
And big thx to you StainlessS I never seemed to be so close to a solution

I tried findcuts but the giving output of timecodes are wrong. One exception is the starting frame(black frame) of the eyecatch
which is given in the timecode but at this rate how should synchronisation be done by cutting still missing the other timecodes? I switched video input for Full and Cut, the given timecode is absolutely different from the first and useless too.

I figured out using findcuts with BilinearResize instead of Spline64Resize doesn't even find the spot where the eyecatch begins. But why?
I have no clue how to process further now...
SilSic is offline   Reply With Quote
Old 1st May 2015, 00:58   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
How bout this to start you off [Scavenged from LocateFrames] :-

Code:
Import("SelectRanges.avs")  # Included with FrameSel() and Prune() [need both + RT_Stats, GScript and DebugView].

Function LocateCuts(clip Cut,clip UnCut,float "Thresh",int "ScanAhead",Int "Start",Int "Stop",
        \ Float "ChromaWeight",String "Cmd",String "DB",bool "Debug",Bool "EAbort") {
    myName      = "LocateCuts: "
    Cut = Cut.Killaudio()   UnCut = UnCut.Killaudio()   
    Thresh      = Float(Default(Thresh, 2.0))
    ScanAhead   = Default(ScanAhead,0)
    Start       = Default(Start,0)
    Stop        = Default(Stop,UnCut.FrameCount)
    CW          = Float(Default(ChromaWeight,1.0/3.0))    
    cmd         = Default(cmd,"")
    DB          = Default(DB,"")
    Debug       = Default(Debug,True)
    EAbort      = Default(EAbort,True)
    ScanAhead   = (ScanAhead==0) ? UnCut.Framecount-1 : ScanAhead 
    ScanAhead   = Min(Max(ScanAhead,1),UnCut.Framecount-1)
    Start       = Min(Max(Start,0),UnCut.Framecount-1) 
    Stop        = Min(Max(Stop,Start),UnCut.Framecount)
    Assert(UnCut.Width==Cut.Width,myName+"- Clip Width mismatch")
    Assert(UnCut.Height==Cut.Height,myName+"- Clip Height mismatch")
    Assert(RT_VarIsSame(Cut,UnCut),myName+"- ColorSpace Mismatch")    # Same colorspace ?
    Assert(Thresh>=0.0 && Thresh<=255.0,myName+"- Invalid Thresh")
    Assert(CW>=0.0 && CW<=1.0,myName+"- Invalid ChromaWeight")
    (Cmd!="") ? RT_FileDelete(Cmd) : NOP
    Cut_UnMatched        = "Cut_UnMatched_Frames.txt"  # Frames in Cut clip that failed to be matched to UnCut clip
    Cut_UnMatched_Ranges = "Cut_UnMatched_Ranges.txt"  # as ranges
    RT_FileDelete(Cut_UnMatched)
    RT_FileDelete(Cut_UnMatched_Ranges)
    Notfound = 0
    Override = 0
    MaxFoundDiff = 0.0  MaxFoundDiff_Frm=-1
    FMT="CUT=%-6d UNCUT=%-6d DIFF=%f START=%d END=%-6d XPCNT=%-3d MATCH=%d  :  OVERRIDE=%d   NOTFOUND=%d"
    GScript("""
        (DB != "") ? RT_DBaseAlloc(DB,Cut.Framecount,"iifiiii") : NOP
        MatchLen = 0
        IxEnd = Cut.Framecount-1
        for (ix = 0, IxEnd) {                           # Iterate through find frames clip.
            sS = Start                                  # Init Start search position
            BestSoFar       = sS                        # Search start position
            BestSoFarDiff   = 256.0                     # Impossible
            mS= 0                                       # NOT FOUND
            eterm=Min(sS+ScanAhead,Stop-1)
            e=eterm                                     # Init to 'scanned all the way'
            Assert(sS<=e,myName+"- Internal Error, sS > e")  # Oops.
            xpCnt=0                                     # Prep XP skip Count
            for(n=sS, eterm) {   # Search c clip(s to eterm) or until satisfactory match found. (eterm evaluated on entry only)
                CurrDiff=RT_FrameDifference(Cut,UnCut,n=ix,n2=n,ChromaWeight=CW)
                if(CurrDiff < BestSoFarDiff) {          # Better match than found so far ?
                    BestSoFar       = n                 # Remember frame number
                    BestSoFarDiff   = CurrDiff          # Remember
                    if(BestSoFarDiff <= Thresh) {       # Good enough to satisfy user requirement ?
                        e=BestSoFar                     # Where we've scanned to so far
                        mS=1                            # Found satisfactory frame, (Flag Thresh)
                        if(BestSoFar < eterm && BestSoFarDiff > 0.0) {
                            tmp = BestSoFar             # Remember
                            for(n=BestSoFar+1,eterm) {
                                CurrDiff=RT_FrameDifference(Cut,UnCut,n=ix,n2=n,ChromaWeight=CW)
                                e=n                                 # We scanned more frames past original BestSoFar
                                if(CurrDiff < BestSoFarDiff) {      # Better match ?
                                    if(ix < ixEnd) {
                                        # Check if XP advance makes problem for next ix find
                                        ChkDiff = RT_FrameDifference(Cut,UnCut,n=ix+1,n2=n,ChromaWeight=CW)
                                        if(ChkDiff>CurrDiff) {              # OK, no problem for next ix iteration
                                            BestSoFar    = n                # Remember frame number
                                            BestSoFarDiff= CurrDiff         # Remember                                        
                                        } Else {            # Override XP advance
RT_DebugF("OVR: %d] [%d]CurrDiff=%f [%d]ChkDiff=%f",n,ix,CurrDiff,ix+1,ChkDiff,name=myName)
                                            Override = Override + 1
                                            n = eterm+1     # Force Exit with current_frame == eterm + 2 (normally exit @ eterm+1)
                                        }                                        
                                    } Else {                                    
                                        BestSoFar    = n                # Remember frame number
                                        BestSoFarDiff= CurrDiff         # Remember
                                    }
                                } else {
                                    n = eterm+1             # Force Exit with current_frame == eterm + 2 (normally exit @ eterm+1)
                                }
                            }
                            if(BestSoFar != tmp) {
                                mS=2                   # Found satisfactory frame, (Flag Thresh, and Xtra Paranoid found better frame)
                                XpCnt=BestSoFar-tmp    # How many frames Xtra Paranoid skipped to find better match than Thresh.
                            }
                        }
                        Start=BestSoFar+1
                        n = eterm + 1                  # Force Exit with current_frame == eterm + 2 (normally exit @ eterm + 1)
                    }
                }
            }
            if(mS == 0) {
                NotFound = NotFound + 1
                # Always write Cut_UnMatched file if any not found, Cut[ix]            
                RT_WriteFile(Cut_UnMatched,"%d # Cut[%d] Best Match = UnCut[%d] Dif=%f",ix,ix,BestSoFar,BestSoFarDiff,Append=True)
                if(EAbort) {
                    RT_DebugF("Cut[%d] Max Found Difference = %f : OVERRIDE Count=%d : NotFound Count = %d",
                        \ MaxFoundDiff_Frm, MaxFoundDiff,Override,NotFound,name=myName)
                    Assert(False,RT_String("%s *** EABORT *** Cut[%d] NOT FOUND : Best Match = UnCut[%d] Dif=%f",myName,ix,BestSoFar,BestSoFarDiff))
                }
            } Else if(BestSoFarDiff > MaxFoundDiff) {
                MaxFoundDiff_Frm = ix                                 
                MaxFoundDiff     = BestSoFarDiff      
            }
            (DEBUG) ? RT_DebugF(FMT,ix,BestSoFar,BestSoFarDiff,sS,e,XpCnt,mS,Override,NotFound,name=myName) : NOP
            (DB != "") ? RT_DBaseSet(DB,ix,   ix,BestSoFar,BestSoFarDiff,sS,e,XpCnt,mS) : NOP
            If(Cmd!="" && mS>0) {                
                RT_WriteFile(Cmd,"%d",BestSoFar,Append=True)                      # UnCut[BestSoFar]
            }
        }
        RT_DebugF("Cut[%d] Max Found Difference = %f : OVERRIDE Count=%d : NotFound Count = %d",
            \ MaxFoundDiff_Frm, MaxFoundDiff,Override,NotFound,name=myName)
        If(Cmd!="") {
            UnCut.FrameSel_CmdReWrite(Cmd,cmd=Cmd,Range=true)                     # Convert frames from UnCut to Ranges, easy reading          
        }            
        if(NotFound != 0) {
            # Also write unmatched Cut Frames as Ranges file  
            Cut.FrameSel_CmdReWrite(Cut_UnMatched_Ranges,cmd=Cut_UnMatched,Range=true)
        }
    """) # End Of GScript
    return NotFound
}

Function MakeCutTestClip(clip c,int "SZ") {
    c
    SZ = Default(SZ,100)
    FC = FrameCount
    c = 0
    GSCript("""
        For(n=0,FC-1,SZ*2) {
            e = Min(n + SZ - 1,FC-1)
            e = (e == n) ? -1 : e
            c2 = Trim(n,e)
            c = (c.IsClip) ? c ++ c2 : c2
#            RT_DebugF("%d ] %d",n,e)
        }
    """)
    return c    
}

######## CONFIG ########
SZ        = 100                  # For Demo TEST ONLY clips
#
SCANAHEAD = Int(SZ * 1.5 + 0.5)  # At least as big as any cut out (can set 0, but will search till end of UnCut clip where missing frames)
CMD       = "UnCut_Cmd.Txt"      # The Frame numbers in CMD are Frame numbers of UnCut clip that sequentially match ALL frames
                                 # in the Cut clip, eg the first file frame number in UnCut clip will be replaced with frame 0 of Cut clip
                                 # etc. On successful completion, converts UnCut_Cmd.Txt to a file of Ranges instead of frames for your
                                 # perusal. On completed but failure, writes Cut_UnMatched_Frames.txt and Cut_UnMatched_Ranges.txt
                                 # so you can see where frames / ranges where not found.
DB        = "Test.DB"
THRESH    = 0.5                  # Adjust for source (MUST use DebugView, and need adjust if change BLURD/BLUR_ARG)
BLURD     = True                 # Blur Detection Clips if True
BLUR_ARG  = 1.58                 # Blurring will likely require different Thresh (0.0 -> 1.58)
EABORT    = True                 # If True, Abort scan on first NOTFOUND and throw error alert, else continue and write files.
######## MAKE Demo TEST CLIPS ########
UnCut=Avisource("D:\avs\Test.avi").RoboCrop(WMod=4,HMod=2,Laced=False)
Cut=UnCut.MakeCutTestClip(sz=SZ).Addborders(4,4,4,4)
UnCut=UnCut.Spline36Resize(UnCut.Width-32,UnCut.Height-32).Addborders(8,8,8,8)
# Lower Qual UnCut clip (spline36 will introduce differences [compared with detection clip Bilinear])
#
######## MAKE SIMILAR (resize to low dimension clip [Bilinear]) ########
UnCut=UnCut.RoboCrop(WMod=4,HMOD=2,Laced=False)
Cut=Cut.RoboCrop(WMod=4,HMod=2,Laced=False)
UBIG   = (UnCut.Width > Cut.Width)
UnCutD = (UBIG)   ? UnCut.BilinearResize(Cut.Width,Cut.Height)   : UnCut    # Detection clips to LOWER dim rez (USE BILINEAR!!!)
CutD   = (!UBIG)  ? Cut.BilinearResize(UnCut.Width,UnCut.Height) : Cut
UncutD = (BLURD)  ? UnCutD.Blur(BLUR_ARG) : UnCutD
CutD   = (BLURD)  ? CutD.Blur(BLUR_ARG)   : CutD
UnCut  = (!UBIG)  ? UnCut.Spline36Resize(Cut.Width,Cut.Height)   : UnCut    # Output clips to Higher rez (Resizer of your choice)
Cut    = (UBIG)   ? Cut.Spline36Resize(UnCut.Width,UnCut.Height) : Cut
#########################################################################
#########################################################################
#########################################################################
ERR=0   # Set no Error, [if comment out below LocateCuts line() ]

# ONCE below line executed SUCCESSFULLY to create CMD file, can comment out to view optional Return clips without re-scan.
ERR=LocateCuts(CutD,UnCutD,Thresh=THRESH,ScanAhead=SCANAHEAD,Cmd=CMD,db=DB,EAbort=EABORT)

Assert(ERR==0, RT_String("*** ERROR *** Some Frames Not Found(%d)",ERR))

Return FrameRep(UnCut,Cut,cmd=CMD,Show=FALSE)           # FINAL OUTPUT:- Replace Uncut frames with Cut Frames

###
UnCutS = UnCut.Subtitle("UnCut",Align=5)
CutS   = Cut.Subtitle("Cut",Align=5)
###
#Return StackHorizontal(CutS.ShowFrameNumber,SelectRanges(UnCutS.ShowFrameNumber,Cmd=CMD))    # Show matching frame numbers
#Return StackHorizontal(Cut,SelectRanges(UnCut,Cmd=CMD))                                      # No frame numbers
#Return RejectRanges(UnCutS.ShowFrameNumber,Cmd=CMD)                                          # Show Frames Missing in CUT clip
#Return FrameRep(UnCutS,CutS,cmd=CMD,Show=True)                                               # Replace Uncut frames with Cut Frames
###
#### Return any of above, OR Drop through to below
# Stripped out of SelectRanges, Return UnCut clip, cut to same as Cut Clip.
REJECT = FALSE                                                                                # Select OR Reject
SHOW   = True
PruneCmd = "~Prune_"+RT_LocalTimeString+".txt"
UnCut.FrameSel_CmdReWrite(PruneCmd,cmd=CMD,Reject=REJECT,Ordered=True,Prune=True,Range=true)  # Re-write command file for Prune().
UncutS.Prune(Cmd=PruneCmd,FadeIn=True,FadeSplice=True,FadeOut=True,Fade=1.0,Show=SHOW)        # Splice Selected/Rejected avoiding audio clicks
RT_FileDelete(PruneCmd)                                                                       # Kill Prune Command file
Return Last
EDITED:
Need to check on Debug output to see that its doing OK, any NOTFOUNDs then maybe Thresh too low
(EDIT: or too hi and gone out of frame sync, see first NOTFOUND frame).
Creates a DBase which you can further scan to find eg frames not in Cut clip.
__________________
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; 6th May 2015 at 00:01. Reason: Update
StainlessS is offline   Reply With Quote
Old 2nd May 2015, 04:09   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
Added this line to previous post.

Code:
Return FrameRep(UnCutS,CutS,cmd=CMD,Show=True)                                             # Replace Uncut frames with Cut Frames
Replaces matched sequences in UNCUT clip with same ones from CUT clip.

EDIT: Clips need to be same size (RoboCrop, Resize) / FrameRate (and same sequence order).

EDIT: Added RoboCrop/Resize (still needs same framerate).
__________________
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; 3rd May 2015 at 16:56.
StainlessS is offline   Reply With Quote
Old 4th May 2015, 13:20   #10  |  Link
SilSic
Registered User
 
Join Date: Aug 2012
Posts: 29
Hey StainlessS,
I'm pretty impressed of your work. Thanks a lot!
Testing the script gives me an error to avoid that could you send me SelectRanges.avs included with FrameSel() and Prune() please?
SilSic is offline   Reply With Quote
Old 4th May 2015, 13:35   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
http://forum.doom9.org/showpost.php?...9&postcount=22

You can find both FrameSel and Prune @Mediafire in my sig, below this post (recent versions have script in AVS folder).

EDIT: You need both plugins not just the script, also RT_Stats and GScript.

EDIT: You will also want DebugView (Google).

EDIT: For the detection clips only, I think I remember that we (Jmac698 and I) decided it was better to resize to lower rez clip size,
so I did it the wrong way around in post #8.
__________________
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; 4th May 2015 at 14:04.
StainlessS is offline   Reply With Quote
Old 4th May 2015, 15:44   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
Updated post #8.
Downscale to lower res for Detection (lower Thresh required).
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 4th May 2015, 17:45   #13  |  Link
SilSic
Registered User
 
Join Date: Aug 2012
Posts: 29
I got this error: framesel_cmdrewrite: cannot open cmd file selectcmd
Where is the output of the final clip to be set?
"MAKE TEST CLIPS" is only for test purpose or is it necessary?
SilSic is offline   Reply With Quote
Old 4th May 2015, 17:49   #14  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
Oops sorry,

Code:
# ONCE below line executed to create CMD file, can comment out to view optional Return clips without re-scan.
#Assert(LocateCuts(CutD,UnCutD,Thresh=THRESH,ScanAhead=SCANAHEAD,Cmd=CMD,db=DB)==0, "LocateCuts: Some Frames Not Found")
Left the comment character in because of testing., just delete '#' (EDITED post).

Quote:
"MAKE TEST CLIPS" is only for test purpose or is it necessary?
Yes, just for test, I (and anybody else that wants to try it) dont have your clips.

EDIT:
Quote:
Where is the output of the final clip to be set?
Added this line to post #8
Code:
Return FrameRep(UnCut,Cut,cmd=CMD,Show=FALSE)                                      # FINAL:- Replace Uncut frames with Cut Frames
__________________
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; 4th May 2015 at 19:14.
StainlessS is offline   Reply With Quote
Old 4th May 2015, 21:16   #15  |  Link
SilSic
Registered User
 
Join Date: Aug 2012
Posts: 29
finally it did his work for over a hour. I got now this error "LocateCuts: Some Frames Not Found"
Is it possible to use it with SetMTmode to speed it up?
I still don't understand where the new clip will be saved to the hdd?
SilSic is offline   Reply With Quote
Old 4th May 2015, 21:31   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
Quote:
"LocateCuts: Some Frames Not Found"
Looks like you need to adjust Thresh, you would need to view the DebugView output for that (I guess that you did not do that).
The script will not work unless all sequences are found.
To save the script, you need to load it into eg VirtualDub/Mod and save Lossless to Hard Drive.

Although if you comment out the line (EDIT: after successful call to LocateCuts)
Code:
Assert(LocateCuts(CutD,UnCutD,Thresh=THRESH,ScanAhead=SCANAHEAD,Cmd=CMD,db=DB)==0, "LocateCuts: Some Frames Not Found")
then you can view any of the return results, and then save to HDD or eg feed straight into MeGUI, or whatever.

In DebugView, if you see any NOTFOUNDS then kill Whatever you are using Vdub/Mplayer investigate the first not found frame.
I'm guessing that the Thresh may be too low, view differences in DebugView (EDIT: Try with/without BLUR and watch DebugView).

EDIT: Try it out on any clean 5 minute SD clip as a test clip so you know what you are doing and how it works.

EDIT:
Quote:
Is it possible to use it with SetMTmode to speed it up?
No idea, I dont use it.
__________________
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; 5th May 2015 at 01:00.
StainlessS is offline   Reply With Quote
Old 5th May 2015, 11:11   #17  |  Link
SilSic
Registered User
 
Join Date: Aug 2012
Posts: 29
frames were not found so I changed mS=0 to mS=1 in hope to tolerate a few missing frames(does it??) and indeed it does seem to work but then the following error came up:
frameRep: *ERROR* Replace frame count != replace clip lenghth(538,540)

Now I see about the output, but it should create a new clip automatically without virtualdub which is again time-consuming to do so for eg. each 200eps,
also frame detection should work automatically without adjustment for any clip no matter what, like already autopano video does all by itself(Automatic motion-based synchronization of the video frames).
What about pattern detection, face detection, black outlines for anime but beside that it should also work for real shows.

Maybe an optional audio alignment could be also very helpful(as guideline or not by considering to tolerate missing frames when audio is same or vice versa) in cases when both clips has japanese audio but only one has english audio so that the english audio can be synchronized.
Or only based of background music which is both in english and japanese the same.
I know is a totally a new way to do so but if frame detection isn't accurate by itself and need adjustment it can be sometimes a better solution.

Last edited by SilSic; 5th May 2015 at 11:15.
SilSic is offline   Reply With Quote
Old 5th May 2015, 20:54   #18  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
DONT change the function as you clearly have no idea what you are doing, you can change the arguments to it but not the code.
Changing mS to 1 means that you found all frames even before you looked for them.
FrameRep can only replace every frame frame from CUT into the position indicated in the cmd file, if there is not one, then it dont know where to put it, FAIL.
Avisynth is a FrameServer, ie it issues frames when requested by another application eg VirtualDub, it does not export any kind of video itself, however,
TWriteAvi plugin can export AVI video but not audio.
Suggest you stick with AutoPano or have a word with Harry Potter.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 6th May 2015, 00:00   #19  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
Thank you SilSic, got your PM and downloading sample right now.
Am still working on this, I shall put up what I have working right now, but am currently attacking from another completely different direction.
Update to post in within a few minutes.

EDIT: Post #8 updated.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 6th May 2015, 00:29   #20  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,797
Hi, Downloaded sample twice, both times comes up as successful download but both times short file (ie corrupt zip).
Can you upload somewhere else, eg MediaFire or SendSpace, thanx.

EDIT:
Thanx for the new links, will D/L in a little while.

Currently got new version (significantly different) which will not screw up just because it failed to find a single frame.
You will be able to search selected range of source clip whose sequences are to be inserted into same sequences in
selected range of dest clip. Sequences do not have to be in same order in both clips (but will be able to reduce timings
if they are). Switched to using RT_QwikScan() to search for frames and is currently searching SD material at about
1500 FPS on 2.4GHz Core Duo (Although that depends greatly upon settings).
Implemented MatchLen, which is number of frames at beginning of sequence that have to be good match or sequence
is rejected (avoid mistakes where similar scenes and high Thresh, currently Default 50 frames).
As implemented, will be able to insert sequences from Cut clip into UnCut clip, OR, just by swapping over clips
in call to function, then can do it the other way around instead (need rescan).
__________________
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; 6th May 2015 at 12:21.
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.