Closed Directory closed 4 years ago
i dont really know what an exe would be doing on linux anyway. but if theres some way to manually point it to /usr/bin/ffmpeg
that might do it
I'm not sure why yours isn't working, but you can specifically point it to /usr/bin/ffmpeg
by putting the following before importing anything else from moviepy:
from moviepy.config import change_settings
change_settings({"FFMPEG_BINARY": "/usr/bin/ffmpeg"})
or you can manually edit the file config_defaults.py
.
Note that this will change in v2.0 (#1109). Either it will be fixed, or you'll have to use an environment variable.
If you'd like help fixing the actual problem of ffmpeg not being auto-detected, please provide the full traceback error that you get.
even that raises the same error.
File "/home/project/project/server.py", line 14, in <module>
from moviepy.config import change_settings
File "/home/project/env/lib/python3.8/site-packages/moviepy/config.py", line 30, in <module>
FFMPEG_BINARY = get_exe()
File "/home/project/env/lib/python3.8/site-packages/imageio/plugins/ffmpeg.py", line 49, in get_exe
return imageio_ffmpeg.get_ffmpeg_exe()
File "/home/project/env/lib/python3.8/site-packages/imageio_ffmpeg/_utils.py", line 49, in get_ffmpeg_exe
raise RuntimeError(
RuntimeError: No ffmpeg exe could be found. Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable.
Ok, try this before importing moviepy:
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "/usr/bin/ffmpeg"
hmm that actually does seem to work. it imports without error. ill get back with a follow up if it actually works works and close the issue
Sure. It’s not a great solution, but maybe it will be properly fixed in v2.0.
Hi, I am also getting the same error while working in pydroid for Android (similar to linux environment)
But I am not able to solve this issue even after the import os
. My error-
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 4, in <module>
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/moviepy/video/io/VideoFileClip.py", line 88, in __init__
self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_reader.py", line 35, in __init__
infos = ffmpeg_parse_infos(filename, print_infos, check_duration,
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_reader.py", line 257, in ffmpeg_parse_infos
proc = sp.Popen(cmd, **popen_params)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/subprocess.py", line 856, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/subprocess.py", line 1728, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/ffmpeg'
Any help will be appreciated :)
Hi, I am also getting the same error while working in pydroid for Android (similar to linux environment) But I am not able to solve this issue even after the
import os
. My error-Traceback (most recent call last): File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile) File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 4, in <module> File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/moviepy/video/io/VideoFileClip.py", line 88, in __init__ self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt, File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_reader.py", line 35, in __init__ infos = ffmpeg_parse_infos(filename, print_infos, check_duration, File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_reader.py", line 257, in ffmpeg_parse_infos proc = sp.Popen(cmd, **popen_params) File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/subprocess.py", line 856, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/subprocess.py", line 1728, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/ffmpeg'
Any help will be appreciated :)
sudo apt install ffmpeg it will fix the issue
Ok, try this before importing moviepy:
import os os.environ["IMAGEIO_FFMPEG_EXE"] = "/usr/bin/ffmpeg"
It works for me
The issue is that this appears on our HPC system sporadically, during model training.
So even if previous calls worked, this could happen during the same RunTime. There must be something pathological going on.
it shows RuntimeError: No ffmpeg exe could be found. Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable. while using on android
please help!
it shows RuntimeError: No ffmpeg exe could be found. Install ffmpeg on your system, or set the IMAGEIO_FFMPEG_EXE environment variable. while using on android
please help!
@patellalit1507
Termux, apt install ffmpeg
step 1
python3 -m pip install moviepy
step 2
apt install ffmpeg
step 1
python3 -m pip install moviepy
step 2
apt install ffmpeg
Unfortunately, this doesn't work. Trying to run it on pydroid 3, Android version 12.
For those on MAC, if you install ffmpeg with Homebrew, then the path is different, so the code become :
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "/opt/homebrew/Cellar/ffmpeg/5.1/bin/ffmpeg"
For those in Windows: backward slash and forward slash is not the same. tburrows13 solution does work but you have to use the forward slash for the destination of ffmpeg and not backslashes. If you want to use backslashes then you have to use double backslashes:
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "C:/ffmpeg/bin/ffmpeg.exe"
or
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "C:\\ffmpeg\\bin\\ffmpeg.exe"
(correct for your actual ffmpeg location)
For those on MAC, if you install ffmpeg with Homebrew, then the path is different, so the code become :
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "/opt/homebrew/Cellar/ffmpeg/5.1/bin/ffmpeg"
this worked for me, because I have installed ffmpeg with brew
For those on MAC, if you install ffmpeg with Homebrew, then the path is different, so the code become :
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "/opt/homebrew/Cellar/ffmpeg/5.1/bin/ffmpeg"
this worked for me, because I have installed ffmpeg with brew
Is there an equivalent environmental flag for libraries? Here's why:
My homebrew installed into Cellar/ffmpeg/5.1.2.reinstall/...
but when that executable runs it still searches for libraries in the /5.1.2/
directory. It seems like an error in an iOS system but this is not my expertise.
dyld[54363]: Library not loaded: /opt/homebrew/Cellar/ffmpeg/5.1.2/lib/libavdevice.59.dylib
Referenced from: <D4B0734B-405C-3440-A545-A06D935C834D> /opt/homebrew/Cellar/ffmpeg/5.1.2.reinstall/bin/ffmpeg
Reason: tried: '/opt/homebrew/Cellar/ffmpeg/5.1.2/lib/libavdevice.59.dylib' (no such file),
For those on MAC, if you install ffmpeg with Homebrew, then the path is different, so the code become :
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "/opt/homebrew/Cellar/ffmpeg/5.1/bin/ffmpeg"
this worked for me, because I have installed ffmpeg with brew
Is there an equivalent environmental flag for libraries? Here's why: My homebrew installed into
Cellar/ffmpeg/5.1.2.reinstall/...
but when that executable runs it still searches for libraries in the/5.1.2/
directory. It seems like an error in an iOS system but this is not my expertise.dyld[54363]: Library not loaded: /opt/homebrew/Cellar/ffmpeg/5.1.2/lib/libavdevice.59.dylib Referenced from: <D4B0734B-405C-3440-A545-A06D935C834D> /opt/homebrew/Cellar/ffmpeg/5.1.2.reinstall/bin/ffmpeg Reason: tried: '/opt/homebrew/Cellar/ffmpeg/5.1.2/lib/libavdevice.59.dylib' (no such file),
line in my python file is contains the 5.1.2 as it is the current version (not 5.1): os.environ["IMAGEIO_FFMPEG_EXE"] = "/opt/homebrew/Cellar/ffmpeg/5.1.2/bin/ffmpeg"
I'm not sure what is this "5.1.2.reinstall". Why is there the "reinstall" word ? No idea, it should be clean 5.1.2 IMO
@justnpT: Thank you. That is not the question. The name differential is connected to homebrew. The question is whether a separate library flag is in the environment variables.
https://github.com/imageio/imageio-ffmpeg : If you're using a Conda environment: the conda package does not include the ffmpeg executable, but instead depends on the ffmpeg package from conda-forge. Install using:
$ conda install imageio-ffmpeg -c conda-forge
I solved this issue by following the steps
Setting "IMAGEIO_FFMPEG_EXE" didn't work for me.
I had to specify the path in mediapy/__init__.py
class _Config:
ffmpeg_name_or_path: _Path = r"D:\Programs\ffmpeg\bin\ffmpeg.exe" # insert ffmpeg.exe path here
show_save_dir: _Path | None = None
For Mac users, use this command:
brew install ffmpeg
For Mac users, use this command:
brew install ffmpeg
That made the trick for me. Thank you.
Hi, I am also getting the same error while working in pydroid for Android (similar to linux environment) But I am not able to solve this issue even after the
import os
. My error-Traceback (most recent call last): File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile) File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 4, in <module> File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/moviepy/video/io/VideoFileClip.py", line 88, in __init__ self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt, File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_reader.py", line 35, in __init__ infos = ffmpeg_parse_infos(filename, print_infos, check_duration, File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_reader.py", line 257, in ffmpeg_parse_infos proc = sp.Popen(cmd, **popen_params) File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/subprocess.py", line 856, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/subprocess.py", line 1728, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/ffmpeg'
Any help will be appreciated :)
sudo apt install ffmpeg it will fix the issue
brew install ffmpeg worked for me on mac!
os.environ["IMAGEIO_FFMPEG_EXE"] = "/usr/bin/ffmpeg"
How about run in server???
[Searching Followers: Spotify]
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/ripecekcu/?__a=1&__d=dis) >>>
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/ripecekcu/?__a=1&__d=dis) >>>
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/ripecekcu/?__a=1&__d=dis) >>>
Analyzing video file "/storage/emulated/0/Python/joshxantus_3329633938699010847.mp4"
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in
[Program finished]
I tried ffmpeg also THIS IS FIR ANDROID ON PYDROID
I solved this issue by following the steps
- Download the FFmpeg package from the official website.
- Choose the Static builds for macOS 64-bit.
- add the exe file to directory
- set env: import os os.environ["IMAGEIO_FFMPEG_EXE"] = "/Users/.../ffmpeg"
works great, thanks mate
did anyone notice here? we are not talking about WINDOWS or MAC
WE ARE TALKING ABOUT ANDROID SYSTEM
A household appliances company in the Netherlands and all of Europe, King Import Export, announces the theft of a container of household appliances and warns customers to beware of purchasing the product without invoices. The invoice must bear the company seal, King Import Export, so as not to be exposed to problems.
Uploading 059aaa29-5a63-4e8b-9546-9d696c1496c9.mov…
![Uploading da297ad3-6b86-4caa-877d-92cb0f043b25.jpeg…]()
I solved this issue by following the steps
Download the FFmpeg package from the official website.
Choose the Static builds for macOS 64-bit.
add the exe file to directory
set env:
import os
os.environ["IMAGEIO_FFMPEG_EXE"] = "/Users/.../ffmpeg"
works great, thanks mate
Expected Behavior
not getting an error
Actual Behavior
getting the error in the title
Steps to Reproduce the Problem
be me and try to run
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
ffmpeg is installed with apt and i can confirm its location in
/usr/bin/
. additionally ive also executedpip install imageio-ffmpeg
in the python virtual environment and it is installed. ive loggedplatform.python_version()
to confirm i was in the 3.8.0 venv. executing a plain interpreter terminal in the venv and trying to import it manually does not resault in an error. only during execution. the execution is in a flask application deployed with gunicorn and nginx.Specifications