smacke / ffsubsync

Automagically synchronize subtitles with video.
MIT License
6.84k stars 281 forks source link

Syncing via bazarr failed (exception) #134

Open thomasvt1 opened 3 years ago

thomasvt1 commented 3 years ago

Upload a tarball with debugging information

  1. Run the command that produces the out-of-sync subtitle output, but with the additional --make-test-case flag, i.e.: subsync ref.mkv -i in.srt -o failed.srt --make-test-case
  2. This results in a file of the form ref.mkv.$timestamp.tar.gz or similar.
  3. Please upload this file using the "attach files" button at the bottom of the text prompt. 101 Dalmatians (1996) {tmdb-11674}.mkv.2021-09-19-12-03-04.tar.gz

That's all! Thank you for contributing a test case; this helps me to continue improving the sync and to add additional integration tests once improvements have been made.

Additional context Add any other context about the problem here that might be helpful. Bazarr error log; BAZARR an exception occurs during the synchronization process for this subtitles: /movies/101 Dalmatians (1996) {tmdb-11674}/101 Dalmatians (1996) {tmdb-11674}.nl.srt


19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |utf-8  confidence = 0.99|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |SHIFT_JIS Japanese confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |EUC-JP Japanese confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |GB2312 Chinese confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |EUC-KR Korean confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |CP949 Korean confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |Big5 Chinese confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |EUC-TW Taiwan confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |windows-1251 Russian confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |KOI8-R Russian confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |ISO-8859-5 Russian confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |MacCyrillic Russian confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |IBM866 Russian confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |IBM855 Russian confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |ISO-8859-7 Greek confidence = 0.0|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |windows-1253 Greek confidence = 0.0|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |ISO-8859-5 Bulgairan confidence = 0.0|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |windows-1251 Bulgarian confidence = 0.0|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |TIS-620 Thai confidence = 0.0|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |ISO-8859-9 Turkish confidence = 0.5877259519062737|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |windows-1255 Hebrew confidence = 0.0|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |windows-1255 Hebrew confidence = 0.0|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |windows-1255 Hebrew confidence = 0.0|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |utf-8  confidence = 0.99|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |SHIFT_JIS Japanese confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |EUC-JP Japanese confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |GB2312 Chinese confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |EUC-KR Korean confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |CP949 Korean confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |Big5 Chinese confidence = 0.01|
19/09/2021 11:50:05|DEBUG   |chardet.charsetprober           |EUC-TW Taiwan confidence = 0.01|
19/09/2021 11:50:05|INFO    |ffsubsync.subtitle_parser       |detected encoding: utf-8|
19/09/2021 11:50:06|INFO    |ffsubsync.ffsubsync             |computing alignments...|
19/09/2021 11:50:08|INFO    |ffsubsync.ffsubsync             |...done|
19/09/2021 11:50:08|INFO    |ffsubsync.ffsubsync             |score: 405679.000|
19/09/2021 11:50:08|INFO    |ffsubsync.ffsubsync             |offset seconds: 0.000|
19/09/2021 11:50:08|INFO    |ffsubsync.ffsubsync             |framerate scale factor: 1.000|
19/09/2021 11:50:08|INFO    |ffsubsync.ffsubsync             |writing output to /movies/101 Dalmatians (1996) {tmdb-11674}/101 Dalmatians (1996) {tmdb-11674}.nl.synced.srt|
19/09/2021 11:50:08|ERROR   |root                            |BAZARR unable to sync subtitles: /movies/12 Dates of Christmas (2011) {tmdb-81393}/12 Dates of Christmas (2011) {tmdb-81393}.en.srt|
19/09/2021 11:50:12|INFO    |ffsubsync.ffsubsync             |...done|```
smacke commented 3 years ago

Hi there, thanks for filing an issue! It looks like ffsubsync has determined that the subtitles are already synced. If you use the pre-synced subtitles, does it look OK?

I'm not sure why Bazarr indicates that an error occurred -- perhaps it's checking that ffsubsync has a nonzero shift, but if the subtitles are already synced, then a zero shift should be acceptable. If it looks like the subtitles are already synced, I'd recommend filing an issue against Bazarr. Can you confirm whether the pre-synced subtitles look OK?

thomasvt1 commented 3 years ago

Thanks @smacke for the quick reply, it indeed seems the pre-synced ones are already synced. I'll open a issue on Bazarr and see what they say :)

Thanks for the help!

morpheus65535 commented 3 years ago

@smacke hey mate. We don't check the offset second. The only check we do is test os.path.isfile() and if not, we exit the syncing process because we assume ffsubsync haven't created the synced output srt file.

https://github.com/morpheus65535/bazarr/blob/master/bazarr/subsyncer.py#L82-L83

smacke commented 3 years ago

@morpheus65535 thanks for the extra context!

Ohhh my bad, I see now. It's not 101 dalmations for which the sync failed, it's 12 days of christmas. @thomasvt1 mind attaching the debug info for this one?

thomasvt1 commented 3 years ago

12 dates indeed fails again, good catch! 12 Dates of Christmas (2011) {tmdb-81393}.mp4.2021-09-21-08-47-28.tar.gz

21/09/2021 08:45:26|DEBUG   |root                            |BAZARR FFprobe used is /usr/bin/ffprobe|
21/09/2021 08:45:26|DEBUG   |root                            |BAZARR returning this binary: /usr/bin/ffmpeg|
21/09/2021 08:45:26|DEBUG   |root                            |BAZARR FFmpeg used is /usr/bin/ffmpeg|
21/09/2021 08:45:26|INFO    |ffsubsync.ffsubsync             |extracting speech segments from reference '/movies/12 Dates of Christmas (2011) {tmdb-81393}/12 Dates of Christmas (2011) {tmdb-81393}.mp4'...|
21/09/2021 08:45:26|INFO    |ffsubsync.speech_transformers   |Checking video for subtitles stream...|
21/09/2021 08:45:26|INFO    |ffsubsync.speech_transformers   |Video file appears to lack subtitle stream|
21/09/2021 08:45:45|INFO    |ffsubsync.ffsubsync             |...done|
21/09/2021 08:45:45|INFO    |ffsubsync.ffsubsync             |extracting speech segments from subtitles file(s) ['/movies/12 Dates of Christmas (2011) {tmdb-81393}/12 Dates of Christmas (2011) {tmdb-81393}.en.srt']...|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |utf-8  confidence = 0.99|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |SHIFT_JIS Japanese confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |EUC-JP Japanese confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |GB2312 Chinese confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |EUC-KR Korean confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |CP949 Korean confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |Big5 Chinese confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |EUC-TW Taiwan confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |windows-1251 Russian confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |KOI8-R Russian confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |ISO-8859-5 Russian confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |MacCyrillic Russian confidence = 0.0|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |IBM866 Russian confidence = 0.0|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |IBM855 Russian confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |ISO-8859-7 Greek confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |windows-1253 Greek confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |ISO-8859-5 Bulgairan confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |windows-1251 Bulgarian confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |TIS-620 Thai confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |ISO-8859-9 Turkish confidence = 0.5582112859604998|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |windows-1255 Hebrew confidence = 0.0|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |windows-1255 Hebrew confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |windows-1255 Hebrew confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |utf-8  confidence = 0.99|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |SHIFT_JIS Japanese confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |EUC-JP Japanese confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |GB2312 Chinese confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |EUC-KR Korean confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |CP949 Korean confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |Big5 Chinese confidence = 0.01|
21/09/2021 08:45:46|DEBUG   |chardet.charsetprober           |EUC-TW Taiwan confidence = 0.01|
21/09/2021 08:45:46|INFO    |ffsubsync.subtitle_parser       |detected encoding: utf-8|
21/09/2021 08:45:46|INFO    |ffsubsync.ffsubsync             |computing alignments...|
21/09/2021 08:45:48|ERROR   |ffsubsync.ffsubsync             |Synchronization failed; consider passing --max-offset-seconds with a number larger than 60|
21/09/2021 08:45:48|ERROR   |root                            |BAZARR unable to sync subtitles: /movies/12 Dates of Christmas (2011) {tmdb-81393}/12 Dates of Christmas (2011) {tmdb-81393}.en.srt|