smacke / ffsubsync

Automagically synchronize subtitles with video.
MIT License
6.74k stars 278 forks source link

Ignore subtitle stream in video #131

Closed attinderdhillon closed 3 years ago

attinderdhillon commented 3 years ago

I have some videos with embedded subtitles, not in sync. After extracting or downloading subtitles How to force "voice activity detection" for syncing?

smacke commented 3 years ago

Hmm I think ffsubsync usually expects the unsynced subs to be outside the video so you'll have to extract them first, then tell it to use webrtc as the vad. I think the following two commands would work:

ffs vid.mkv --extract-subtitles-from-stream 0 -o unsynced.srt
ffs vid.mkv -i unsynced.srt -o synced.srt --vad webrtc

There was a bug where extract-subtitles-from-stream wasn't working so I just pushed a fix. If going this route you'll need to upgrade: pip install --upgrade ffsubsync

Somehow the docs lost content so I'll figure out what's going on with that; until then please let me know if this works / if you have other questions :)

attinderdhillon commented 3 years ago

I upgraded "argparse-1.4.0 ffsubsync-0.4.16" but still getting error extracting -- ffs: error: unrecognized arguments: --extract-subtitles-from-stream 0

The second command worked just as I wanted, Thanks :)

smacke commented 3 years ago

Woops, it's ffs vid.mkv --extract-subs-from-stream 0 -o unsynced.srt to extract the subtitles to file unsynced.srt but I misread your question and didn't realize you had already obtained the unsynced subtitles from elsewhere and so didn't need to do this extraction. Anyway glad the second command worked! Will go ahead and close the issue but please let me know if you have any other questions.