Recently, I was working on a script that gets captions from videos and downloads stock photos based on those captions. I wanted to get the captions, but pvleopard only takes mp3 files, so I tried converting mp4 to mp3 through moviepy. when I imported moviepy, it spat out this error:
RuntimeError: No ffmpeg exe could be found. Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable.
I had thought it was a simple issue, so I used git to clone ffmpeg to my project and then use os.environ to set IMAGEIO_FFMPEG_EXE.
However, I couldn’t find FFMPEG.EXE in the source code. I have been digging, And I am still unable to find it.
Here is the full code, for anyone wondering (no I have not import pvleopard yet I couldn’t convert mp4)
import pvleopard as pv, moviepy.editor as mpe, os, tqdm as t os.environ['IMAGEIO_FFMPEG_EXE'] = os.path.join("path", "to", "ffmpeg.exe") ogVid = input("What video what you like to download stock images for?\n") try: video = mpe.VideoFileClip(os.path.join("path","to", ogVid)) video.audio.write_audiofile(os.path.join("path","to","exportAudio.mp3")) except: print("[ERROR] invalid input")