-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: module 'ffmpeg' has no attribute 'input' #174
Comments
|
I had the same error, because |
try another filename (don't use same name as your imported package) |
It doesn't solve my problem.
|
I'm guessing this happens if you've installed both, ffmpeg and ffmpeg-python. and install ffmpeg-python again with : This solved the problem in my system :) |
I have same problem, install and uninstall the module multiple times. but i forgot to install |
you will probably end up with that exact error if you do : instead of : at least, I did ... |
The use of "mmpeg" library was throwing `"AttributeError: module 'ffmpeg' has no attribute 'input'"` That was due to the incorrect "ffmpeg" library being installed. It seems the intended library is in fact [ffmpeg-python](https://github.com/kkroening/ffmpeg-python). More info in this issue: kkroening/ffmpeg-python#174
If I install ffmpeg + ffmpeg-python I see the same issue. If I install only ffmpeg-python I see |
If you're silly like me and create a file named Therefore, The solution to this: Make sure your Python file isn't named ffmpeg.py |
thank you! If it wasn't for you, I would have been tortured to death. |
step 1:sudo apt install ffmpeg |
Thank you very much! |
Thanks, you help me a lot! |
I've tried all of the above solutions, I either get or
I've tried uninstall and re-installing in various different orders |
I still have this problem in the Jupyter notebook, so I use vs code.
if you get this, you just need to turn colored frames into video. |
I'm working in vscode and I still run into this issue. |
I had the same problem until I tried |
The answer is here. You probably didn't install ffmpeg completely and setup the environmental variables. Link shows all the steps. |
May your interpreter has no ffmpeg-python |
I used |
pip install python-ffmpegthis is right |
Finally worked for me after doing this,
So try installing with pip3.. |
This worked for me:
|
I have a very simple code - model = whisper.load_model("base") Have tried with "pip install python-ffmpeg" when it gave the error - "AttributeError: module 'ffmpeg' has no attribute 'Error'". Then tried with "pip install ffmpeg" and "pip install ffmpeg-python". Now it is throwing this error |
Thanks. you are my hero!It works |
Installing System.Speech from nuget manager resolved this issue. Refered to this link |
As @vinooo1095 suggested already: I'm guessing this happens if you've installed both, Uninstall both with: pip3 uninstall ffmpeg
pip3 uninstall ffmpeg-python Then ONLY install pip3 install ffmpeg-python |
Thanks
Will try
…On Thu, May 11, 2023 at 8:38 PM Radu Sebastian LAZIN < ***@***.***> wrote:
I have a very simple code - [ import whisper
model = whisper.load_model("base") result =
model.transcribe("D:\Newfolder\audio.mp3",fp16=False) print(result["text"])
]
Have tried with "pip install python-ffmpeg" when it gave the error -
"AttributeError: module 'ffmpeg' has no attribute 'Error'". Then tried with
"pip install ffmpeg" and "pip install ffmpeg-python". Now it is throwing
this error [ Traceback (most recent call last): File
"D:\Newfolder\ds\ML\patrec\rec.py", line 4, in result =
model.transcribe("D:\Newfolder\audio.mp3",fp16=False) File
"D:\Newfolder\ds\ML\patrec\venv\lib\site-packages\whisper\transcribe.py",
line 121, in transcribe mel = log_mel_spectrogram(audio, padding=N_SAMPLES)
File "D:\Newfolder\ds\ML\patrec\venv\lib\site-packages\whisper\audio.py",
line 130, in log_mel_spectrogram audio = load_audio(audio) File
"D:\Newfolder\ds\ML\patrec\venv\lib\site-packages\whisper\audio.py", line
46, in load_audio ffmpeg.input(file, threads=0) File
"D:\Newfolder\ds\ML\patrec\venv\lib\site-packages\ffmpeg_run.py", line 313,
in run process = run_async( File
"D:\Newfolder\ds\ML\patrec\venv\lib\site-packages\ffmpeg_run.py", line 284,
in run_async return subprocess.Popen( File "C:\py39\lib\subprocess.py",
line 951, in *init* self._execute_child(args, executable, preexec_fn,
close_fds, File "C:\py39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified ]
Can you please suggest a way-forward for addressing this?
As @vinooo1095 <https://github.com/vinooo1095> suggested already:
I'm guessing this happens if you've installed both, ffmpeg and
ffmpeg-python.
Uninstall both with:
pip3 uninstall ffmpeg
pip3 uninstall ffmpeg-python
Then ONLY install ffmpeg-python again with:
pip3 install ffmpeg-python
—
Reply to this email directly, view it on GitHub
<#174 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL2A3P5WQKIMRAU3LYACSGLXFT6FTANCNFSM4G42CGPA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Still relevant |
sudo pip uninstall ffmpeg |
So I ran into this issue today and came here to see a ton of people talking about solutions that don't work... the real solution here (besides making sure you have ffmpeg and ffmpeg-python installed) is to install ffmpeg manually so that you can access the executables. Whisper is attempting to call ffmpeg by just invoking the "ffmpeg" command line. No pathing is taken into account in these libraries, so you need to install ffmpeg AND make sure it's callable from your python application. Manual ffmpeg installation steps
|
Thanks I was bout to go crazy restarting and reinstalling ffmpeg over and over. |
This worked for me. Thanks a lot! |
For me none of the above solutions worked. However, the following did worked. I was using this in ipynb you can modify the commands as per your environments. Don't change the sequence.
|
This is how it worked for me:
Before that, I had come across 3 types of errors when swaping between ffmpeg and ffmpeg-python pip instalations:
By the way,
|
I solved the problem using this method,thank you very much.Even solved other problem with this solution. |
thanks for solution on docker its ok! |
doesn't work |
Reinstall ffmpeg |
pip install ffmpeg
pip uninstall ffmpeg -y
pip install python-ffmpeg
pip uninstall python-ffmpeg -y
pip install ffmpeg-python
pip uninstall ffmpeg-python -y Then pip install ffmpeg-python |
Traceback (most recent call last):
File "/main/ffmpeg.py", line 1, in
import ffmpeg
File "/main/ffmpeg.py", line 2, in
stream = ffmpeg.input('video.mp4')
AttributeError: module 'ffmpeg' has no attribute 'input'
The text was updated successfully, but these errors were encountered: