Answer the question
In order to leave comments, you need to log in
How to work with ffmpeg-python library?
A simple example from the documentation:
input = ffmpeg.input('reg.mp4')
audio = input.audio.filter("aecho", 0.8, 0.9, 1000, 0.3)
video = input.video.hflip()
out = ffmpeg.output(audio, video, 'out.mp4').run()
Traceback (most recent call last):
File "C:/Users/RokeAlvo/Desktop/js/project/audio/extract_audio.py", line 8, in <module>
out_audio = ffmpeg.output(source_video, 'out.mp4').run()
File "C:\Users\RokeAlvo\Desktop\js\project\audio\venv\lib\site-packages\ffmpeg\_run.py", line 320, in run
overwrite_output=overwrite_output,
File "C:\Users\RokeAlvo\Desktop\js\project\audio\venv\lib\site-packages\ffmpeg\_run.py", line 285, in run_async
args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream
File "C:\Users\RokeAlvo\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "C:\Users\RokeAlvo\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Не удается найти указанный файл
Answer the question
In order to leave comments, you need to log in
I'll answer myself:
The ffmpeg-python library is a wrapper over ffmpeg and requires the latter to be installed on the system (for winows, the path to ffmpeg.exe must be written in PATH). To run a script that uses ffmpeg-python (and pydub, by the way, the same), from a virtual environment, you need to either add the path to ffmpeg to the PATH of the virtual environment, or put ffmpeg.exe in venv/Scripts
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question