Skip to content

Commit

Permalink
added --noOffsetValidation flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaphasilor committed Mar 2, 2022
1 parent 33f8813 commit a3674bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ $ video-sync -h # help page

- `-f, --forceOffset` use the estimated offset as the final offset, no synching

- `-n, --noOffsetValidation` don't check if one of the videos is warped (which could invalidate the offset)

- `-m, --maxOffset=<number>` [default: 120] maximum considered offset between the videos (in seconds) for video syncing.

- `--searchIncrements=<number>` [default: 3] maximum area (video duration, in seconds) to search for the next scene in any direction (forward/backward) before searching in the other direction (requires algorithm=matching-scene)
Expand Down
17 changes: 12 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,13 @@ class VideoSyncCommand extends Command {

// check if one of the videos is warped
let videoWarped = false
const offsetValidationSpinner = ora(`Checking if found offset applies to the whole video...`).start();
try {
videoWarped = ! await validateOffset(args.destination, args.source, videoOffset)
} catch (err) {
console.error(`Error while checking if found offset applies to the whole video:`, err)
if (!flags.noOffsetValidation) {
const offsetValidationSpinner = ora(`Checking if found offset applies to the whole video...`).start();
try {
videoWarped = ! await validateOffset(args.destination, args.source, videoOffset)
} catch (err) {
console.error(`Error while checking if found offset applies to the whole video:`, err)
}
}

// log warning about warped video
Expand Down Expand Up @@ -354,6 +356,11 @@ VideoSyncCommand.flags = {
description: `use the estimated offset as the final offset, no synching`,
default: false,
}),
noOffsetValidation: flags.boolean({
char: `n`,
description: `don't check if one of the videos is warped (which could invalidate the offset)`,
default: false,
}),
maxOffset: flags.integer({
char: `m`,
description: `maximum considered offset between the videos (in seconds) for video syncing.`,
Expand Down

0 comments on commit a3674bb

Please sign in to comment.