ffsubsync icon indicating copy to clipboard operation
ffsubsync copied to clipboard

Maybe add a command to check synchronization?

Open sotiris-bos opened this issue 5 years ago • 2 comments

Hey! Thanks for the amazing work!

What I think would be very useful would be a command to check if the subtitles are already synced with the media. This could help tremendously with large libraries instead of manually checking or blindly running the sync command.

sotiris-bos avatar Jun 27 '19 16:06 sotiris-bos

Hi,

Great suggestion. It turns out that checking for whether the subs are already synced is just as expensive computationally as going ahead and doing the synchronization, but I think there is definitely some room for improvement from a usage standpoint. Maybe add a "--is-already-synced" flag that causes the script to have retcode 0 if synced already and 1 otherwise.

Please feel free to comment if you have some ideas of how this kind of thing might best be consumed downstream.

smacke avatar Jun 29 '19 03:06 smacke

Actually, i use your script to chose best candidate of subtitles between several with a basic bash script :

#!/bin/bash
score=$(subsync "$1" -i "$2" 2>&1 | grep "offset seconds" | cut -d" " -f3)
echo ${score#-}k

But i need to read video file each time, that's why a check of several subtitles will be very useful !

Kitof avatar Apr 26 '20 13:04 Kitof