smacke / ffsubsync

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

Unable to detect speech. Perhaps try specifying a different stream #113

Closed andonevris closed 3 years ago

andonevris commented 3 years ago

Environment (please complete the following information):

Describe the bug Running sync from within bazarr on a win32 machine any attempt to sync a file exits with an error:

Traceback (most recent call last): File "c:\program files\bazarr\bazarr\subsyncer.py", line 56, in sync result = run(self.args) File "c:\program files\bazarr\bazarr\../libs\ffsubsync\ffsubsync.py", line 283, in run reference_pipe.fit(args.reference) File "c:\program files\bazarr\bazarr\../libs\ffsubsync\sklearn_shim.py", line 214, in fit self._final_estimator.fit(Xt, y, **fit_params) File "c:\program files\bazarr\bazarr\../libs\ffsubsync\speech_transformers.py", line 250, in fit raise ValueError(

ValueError: Unable to detect speech. Perhaps try specifying a different stream / track, or a different vad.

To Reproduce Sync on any file causes above error. Have tried with AC3 DTS AAC

Expected behavior Sync file without error

smacke commented 3 years ago

Hi @andonevris, thanks for filing an issue. At first glance this seems more likely to be some issue with how Bazarr embeds ffsubsync (e.g., maybe it doesn't set PATH properly on Windows and ffsubsync can't find ffmpeg as a result).

I would recommend first trying to make sure that you can run ffmpeg from the command line (in order to verify it's on your path). If not, that's likely the issue, and you can fix by setting PATH (see e.g. here). Otherwise I'd recommend filing an issue with Bazarr if you haven't already.

Please let me know how these suggestions work for you!

andonevris commented 3 years ago

ffmpeg is on the path and working correctly via CMD.

I'll see if the bazarr guys can shed any light.

Thanks

smacke commented 3 years ago

@andonevris sorry I forgot to mention before: I would also recommend trying to install ffsubsync and running it manually, to further help narrow down where the issue is coming from.

pip install ffsubsync ffs movie.mkv -i unsynced.srt -o synced.srt

If it's still broken, then we know it's an issue with ffs. If not, it could still be an issue with an older version of ffs, and we can ask @morpheus65535 to try embedding the latest version in Bazarr and seeing if that helps.

morpheus65535 commented 3 years ago

Looking into this. Waiting for debug log from @andonevris. I doubt that's anything else than something related to user environment. I've just tried and was able to sync dozen of subtitles with different audio codecs.

andonevris commented 3 years ago

Your hunch about ffmpeg was right. I had an old ffmpeg.exe referenced on my PATH with higher priority than the latest one.

Deleted the old path and all working now. Thanks for the nudge in the right direction.

smacke commented 3 years ago

Glad things worked out!