compare two video then cut the different I have 2 video files with the same content, but coming from a different source. They have a slight difference in 'cut' and language dubbing, meaning one can be missing a shot compared to the other.
I have a other language dubbed that is correctly timed for one file (call it A), and because of the different cut, a bit off for the other (call it B).
The thing is that “A” also has low quality, while “B” is of better quality, and original language dubbed.
I basically need to fix the timing of the dubbed to match B.
In order to do so, i need to locate the missing/additional shots between the 2 videos, so i know where to cut it..
This is realistic if i have only one pair of files, however i have 20 pair of files !
I would like to automate this search, and basically compare the 2 files at different points in time, and find where they diverge.
How can I do this?
Since file A has other dubbed language, the comparison method should be exact enough to detect content difference..
A Clip(C) is a sequence of frames, each frame(f) consists of video and audio frames, the duration(t) of each frame is constant and is determined by the frame rate.
For the i th clip(Ci), it is defined as (fi_n) n∈ℕ
back to your question, the idea is to find the result of
⊕Cj , where j ∈ {0,…,19}
Since the sizes of all Cj are not the same, the elements or frames of ⊕Cj are not guaranteed to be monotonic increasing. Therefore, different frames, with expected sequence, cannot be identified in this problem.
=======
IF you can guarantee the sizes of all Cj to be the same,
a video frame can be extracted by ffmpeg to a png file and a audio frame can be extracted by the t second of wav file. The ⊕ operation can be handled by image diff and easily be found in Google.