I'm trying edit a MP4 video using ffmpeg-python library but I get
TypeError: 'ffmpeg' has no attribute 'input'
Here is my code, directly copied from the official repository):
import ffmpeg
x=ffmpeg.input('xx.mp4')
x=ffmpeg.hflip(x)
x=ffmpeg.output(x,'yy.mp4')
ffmpeg.run(x)
I'm very confused about this error.
Can anyone help me to figure out??
Thanks.
From a tiny bit of googling : you probably installed the wrong ffmeg python library.
You can use
pip install ffmpeg-pythonto be sure to install the correct one.you can also list the installed modules with
pip listand manually inspect if there is indeed another module sharing the name ffmpeg.You can also manually inspect the ffmpeg file to ensure it is the right one :
This output something like
You can then open the file
some_path/_ffmpeg.pyand check that it has the desiredinputattribute. As offfmpeg-pythonversion0.2.0, the file begins like this :