Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative algorithm for syncing #3

Merged
merged 13 commits into from
Jul 27, 2021
Merged

Alternative algorithm for syncing #3

merged 13 commits into from
Jul 27, 2021

Conversation

Chaphasilor
Copy link
Owner

Implemented a second algorithm for finding the offset between the two videos, based on scene changes (two very distinct frames) instead of a single frame.
This should be much more robust, but can potentially take a very long time.

The new algorithm doesn't support all of the "old" flags, and vice versa. Most flags should be supported though (if it makes sense to change them).

Independently of the used algorithm, the found offset will now be checked against multiple positions in the video in order to detect warped videos (slightly slowed down or sped up). One can only tell that a video is warped when letting a non-warped version run in parallel, or after trying to synch in an audio track.
This new feature will warn the user if one of the videos is slower or faster than the other (which causes the offset to be more and more incorrect with increased distance from the initial search position), and will prompt them if they want to continue merging.
In the future, the tool could also try to un-warp the video, but that would be a lot of work and there's no way to tell which of the two videos is the warped one, and which has the original speed.

- increases robustness
- if the first search doesn't yield the right scene, it keeps searching
- switches between searching upwards and downwards
- searches until matching scene is found or maxOffset it reached
- needs some more polish
- removed a few options and cli arguments
@Chaphasilor Chaphasilor self-assigned this Jul 27, 2021
@Chaphasilor Chaphasilor merged commit a3aebdf into main Jul 27, 2021
@Chaphasilor Chaphasilor linked an issue Jul 27, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for speed warping
1 participant