m1guelpf / yt-whisper

Using OpenAI's Whisper to automatically generate YouTube subtitles
MIT License
1.36k stars 138 forks source link

I keep getting this error. #24

Open swankwc opened 1 year ago

swankwc commented 1 year ago

line 8, in sys.exit(main()) File "/Users/wesley/miniconda3/lib/python3.9/site-packages/yt_whisper/cli.py", line 49, in main result = model.transcribe(audio_path, **args) File "/Users/wesley/miniconda3/lib/python3.9/site-packages/whisper/transcribe.py", line 84, in transcribe mel = log_mel_spectrogram(audio) File "/Users/wesley/miniconda3/lib/python3.9/site-packages/whisper/audio.py", line 111, in log_mel_spectrogram audio = load_audio(audio) File "/Users/wesley/miniconda3/lib/python3.9/site-packages/whisper/audio.py", line 46, in load_audio except ffmpeg.Error as e: AttributeError: module 'ffmpeg' has no attribute 'Error'

HardikJain02 commented 1 year ago

pip install --ffmpeg-python

swankwc commented 1 year ago

pip install --ffmpeg-python Done but now I'm getting this. (base) Wesleys-MacBook-Air:whisper-ui wesley$ pip install --ffmpeg-python

Usage:
pip install [options] [package-index-options] ... pip install [options] -r [package-index-options] ... pip install [options] [-e] ... pip install [options] [-e] ... pip install [options] <archive url/path> ...

no such option: --ffmpeg-python

iwasthesword commented 1 year ago

The correct command should be pip install ffmpeg-python

swankwc commented 1 year ago

The correct command should be pip install ffmpeg-python

After running that it appears to install correctly, however. Any idea how to fix the following?

Running setup.py install for future ... done Successfully installed ffmpeg-python-0.2.0 future-0.18.2 (ytwhisper) Wesleys-MacBook-Air:whisper wesley$ pip install git+https://github.com/m1guelpf/yt-whisper.git Collecting git+https://github.com/m1guelpf/yt-whisper.git Cloning https://github.com/m1guelpf/yt-whisper.git to /private/var/folders/_c/wd0r0w017lx_84wcssfhc4_80000gn/T/pip-req-build-vsqkbx64 Running command git clone --filter=blob:none --quiet https://github.com/m1guelpf/yt-whisper.git /private/var/folders/_c/wd0r0w017lx_84wcssfhc4_80000gn/T/pip-req-build-vsqkbx64 Resolved https://github.com/m1guelpf/yt-whisper.git to commit 0190e7e3cdafb015b1325e30e80e558af7d7c57f Preparing metadata (setup.py) ... done Collecting whisper@ git+https://github.com/openai/whisper.git@main#egg=whisper Cloning https://github.com/openai/whisper.git (to revision main) to /private/var/folders/_c/wd0r0w017lx_84wcssfhc4_80000gn/T/pip-install-zb88p2el/whisper_e9368e70f18245589ccfec7d6780b2b7 Running command git clone --filter=blob:none --quiet https://github.com/openai/whisper.git /private/var/folders/_c/wd0r0w017lx_84wcssfhc4_80000gn/T/pip-install-zb88p2el/whisper_e9368e70f18245589ccfec7d6780b2b7 Resolved https://github.com/openai/whisper.git to commit 28769fcfe50755a817ab922a7bc83483159600a9 Preparing metadata (setup.py) ... done Collecting yt-dlp Using cached yt_dlp-2023.1.6-py2.py3-none-any.whl (2.8 MB) Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from whisper@ git+https://github.com/openai/whisper.git@main#egg=whisper->yt-whisper==1.0) (1.23.5) INFO: pip is looking at multiple versions of yt-whisper to determine which version is compatible with other requirements. This could take a while. ERROR: Could not find a version that satisfies the requirement torch (from whisper) (from versions: none) ERROR: No matching distribution found for torch (ytwhisper) Wesleys-MacBook-Air:whisper wesley$ yt_whisper "https://www.youtube.com/watch?v=dQw4w9WgXcQ" Downloaded video "Rick Astley - Never Gonna Give You Up (Official Music Video)". Generating subtitles... Traceback (most recent call last): File "/opt/homebrew/lib/python3.10/site-packages/whisper/audio.py", line 42, in load_audio ffmpeg.input(file, threads=0) AttributeError: module 'ffmpeg' has no attribute 'input'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/homebrew/bin/yt_whisper", line 8, in sys.exit(main()) File "/opt/homebrew/lib/python3.10/site-packages/yt_whisper/cli.py", line 49, in main result = model.transcribe(audio_path, **args) File "/opt/homebrew/lib/python3.10/site-packages/whisper/transcribe.py", line 84, in transcribe mel = log_mel_spectrogram(audio) File "/opt/homebrew/lib/python3.10/site-packages/whisper/audio.py", line 111, in log_mel_spectrogram audio = load_audio(audio) File "/opt/homebrew/lib/python3.10/site-packages/whisper/audio.py", line 46, in load_audio except ffmpeg.Error as e: AttributeError: module 'ffmpeg' has no attribute 'Error'

HardikJain02 commented 1 year ago

https://github.com/kkroening/ffmpeg-python/issues/174#issuecomment-561546739