View Single Post
Old 13th December 2020, 23:35   #2  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,695
I am just about to scan an hour of video for duplicates, so I'm revisiting my old dup detection script. It is the same as yours, but has the ability to write the frame numbers to a file.

Code:
#This script finds exact duplicate frames and outputs the frame numbers

global blankthreshold=3

filename = "e:\output_duplicate_frames.txt"
AVISource("e:\fs.avi").killaudio()
i=AssumeBFF.ConvertToYV12

#This line below will output EVERY frame that is below threshold, which results in LOTS of frames
#Normally you don't do this, but it is included for those who want this capability.
#WriteFileIf(last, filename,  "(YDifferenceFromPrevious(i)<=blankthreshold)", "current_frame+1", append = false)

#The line below writes the FIRST frame that falls below the threshold
#WriteFileIf(last, filename,  "(YDifferenceFromPrevious(i)>blankthreshold)&&YDifferenceToNext(i)<=blankthreshold", "current_frame", append = false)

#Use this instead of WriteFile in order to determine blankthreshold
ScriptClip("Subtitle(String(YDifferenceFromPrevious(i)))")
This particular video I'm about to work on has dozens of duplicates in a row, where the streaming service froze. I simply want to create a marker in my NLE that will appear at the beginning of the dups, and then go in and edit out the bad spot. Thus, I only want the frame number of the first frame in a string of duplicates.
johnmeyer is offline   Reply With Quote