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'
pip install ffmpeg-python
instead of
pip install ffmpeg
I had the same error, because python-ffmpeg was installed instead of ffmpeg-python. Therefore this can be considered as fixed.
try another filename (don't use same name as your imported package)
It doesn't solve my problem.
I have install pip install ffmpeg-python
import ffmpeg
filep = '/path/to/my/file.mp4'
stream = ffmpeg.input(filep)
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'ffmpeg' has no attribute 'input'
I'm guessing this happens if you've installed both, ffmpeg and ffmpeg-python.
uninstall both with:
pip uninstall ffmpeg
pip uninstall ffmpeg-python
and install ffmpeg-python again with :
pip install ffmpeg-python
This solved the problem in my system :)
I have same problem, install and uninstall the module multiple times.
but i forgot to install ffmpeg package.
you will probably end up with that exact error if you do :
pip install python-ffmpeg
instead of :
pip install ffmpeg-python
at least, I did ...

Most helpful comment
I'm guessing this happens if you've installed both, ffmpeg and ffmpeg-python.
uninstall both with:
pip uninstall ffmpegpip uninstall ffmpeg-pythonand install ffmpeg-python again with :
pip install ffmpeg-pythonThis solved the problem in my system :)