joaquintorres / autosubsync-mpv

Automatic subtitle synchronization script for mpv media player
MIT License
135 stars 13 forks source link

extracting speech segments from reference ffsubsync.py:444 #27

Open Lovecraft-github opened 4 months ago

Lovecraft-github commented 4 months ago

I'm getting this error when trying to sync a subtitle the complete error is ` autosubsync: Starting ffsubsync... autosubsync: [14:53:46] INFO extracting speech segments from reference ffsubsync.py:444 autosubsync: 'video.mp4'...
autosubsync: Traceback (most recent call last): autosubsync: File "/home/user/.local/bin/ffsubsync", line 8, in autosubsync: sys.exit(main()) autosubsync: ^^^^^^ autosubsync: File "/home/user/.local/share/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/ffsubsync.py", line 727, in main autosubsync: return run(parser)["retval"] autosubsync: ^^^^^^^^^^^ autosubsync: File "/home/user/.local/share/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/ffsubsync.py", line 509, in run autosubsync: sync_was_successful = _run_impl(args, result) autosubsync: ^^^^^^^^^^^^^^^^^^^^^^^ autosubsync: File "/home/user/.local/share/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/ffsubsync.py", line 445, in _run_impl autosubsync: reference_pipe.fit(args.reference) autosubsync: File "/home/user/.local/share/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/sklearn_shim.py", line 255, in fit autosubsync: self._final_estimator.fit(Xt, y, **fit_params) autosubsync: File "/home/user/.local/share/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/speech_transformers.py", line 333, in fit autosubsync: detector = _make_webrtcvad_detector( autosubsync: ^^^^^^^^^^^^^^^^^^^^^^^^^ autosubsync: File "/home/user/.local/share/pipx/venvs/ffsubsync/lib/python3.12/site-packages/ffsubsync/speech_transformers.py", line 136, in _make_webrtcvad_detector autosubsync: import webrtcvad autosubsync: File "/home/user/.local/share/pipx/venvs/ffsubsync/lib/python3.12/site-packages/webrtcvad.py", line 1, in autosubsync: import pkg_resources autosubsync: ModuleNotFoundError: No module named 'pkg_resources' autosubsync: Subtitle synchronization failed.

`

I'm using mpv 0.38.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects libplacebo version: v6.338.2 FFmpeg version: n6.1.1 FFmpeg library versions: libavutil 58.29.100 libavcodec 60.31.102 libavformat 60.16.100 libswscale 7.5.100 libavfilter 9.12.100 libswresample 4.12.100

package ffsubsync 0.4.25, installed using Python 3.12.3 (using pipx)

tatsumoto-ren commented 4 months ago

It just says there's a missing module pkg_resources. Maybe you could try installing it.

Lovecraft-github commented 4 months ago

I tried that and no luck, same error. Then I tried with AUR python-ffsubsync 0.4.25-2, error again. Finally, I found python-ffsubsync-venv 0.4.25-4 and this one works. https://aur.archlinux.org/packages/python-ffsubsync-venv. The binary is in ffsubsync_path=/usr/share/ffsubsync-venv/bin/ffsubsync. Well, problem solved I guess :-)

Durden-T commented 3 months ago

pip install setuptools fixed it