core: haffmpeg (hass core) No such file or directory: 'ffmpeg' -- new dependency, unknown new requirement
The problem
Noticing in the logs some errors about missing ffmpeg, I am not sure what integration even this comes from, it is unclear. Also not sure what the impact is.
Environment
- Home Assistant release with the issue:
0.107.5 - Last working Home Assistant release (if known): not sure when it started sorry
- Operating environment (Hass.io/Docker/Windows/etc.): Linux python venv
- Integration causing this issue:
corehaffmpeg - Link to integration documentation on our website: tbd
Problem-relevant configuration.yaml
TBD
Traceback/Error logs
Mar 22 11:11:25 hass hass[32572]: 2020-03-22 11:11:25 ERROR (MainThread) [haffmpeg.core] FFmpeg fails [Errno 2] No such file or directory: 'ffmpeg': 'ffmpeg'
Mar 22 11:11:25 hass hass[32572]: Traceback (most recent call last):
Mar 22 11:11:25 hass hass[32572]: File "/srv/homeassistant/lib/python3.7/site-packages/haffmpeg/core.py", line 136, in open
Mar 22 11:11:25 hass hass[32572]: self._proc = await self._loop.run_in_executor(None, proc_func)
Mar 22 11:11:25 hass hass[32572]: File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
Mar 22 11:11:25 hass hass[32572]: result = self.fn(*self.args, **self.kwargs)
Mar 22 11:11:25 hass hass[32572]: File "/usr/lib/python3.7/subprocess.py", line 800, in __init__
Mar 22 11:11:25 hass hass[32572]: restore_signals, start_new_session)
Mar 22 11:11:25 hass hass[32572]: File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child
Mar 22 11:11:25 hass hass[32572]: raise child_exception_type(errno_num, err_msg, err_filename)
Mar 22 11:11:25 hass hass[32572]: FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg': 'ffmpeg'
Additional information
$ cat /etc/issue
Ubuntu 16.04.6 LTS \n \l
(homeassistant) homeassistant@hass:~/.homeassistant$ python --version
Python 3.7.6
$ pip list | grep mpeg
ha-ffmpeg 2.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 30 (5 by maintainers)
If you run Home Assistant Core, you need solve this problem by your self. I recommend to use Home Assistant as complete solution, which solve that issue for you and all is working automatic
Just ran into this same issue on a fresh Pi 3B+ and was able to mitigate it by installing
ffmpegbefore jumping into the virtual env.sudo apt install ffmpeg -yHome Assistant does not define system dependencies. When running in a virtual environment as you do, system dependencies are your responsibility.
Please install
ffmpeg.I ran into the same issue while following the Raspberry Pi install guide. If ffmpeg is required, then I’m curious to know why it isn’t included in the “INSTALL DEPENDENCIES” section of the guide?
I’ve just done a fresh install on a Pi in a venv, following the documentation. This dependency isn’t listed anywhere and doesn’t make sense before any integrations have been configured.
If it’s a hard dependency, then it should be described in the documentation. And while that’s being improved, those instructions just have the user run hass directly instead of even talking about how to make a systemd service, etc. Not everybody wants to dedicate a Pi to a single application. (I’ve traditionally run Homebridge and the Unifi Controller on the same Pi as Home Assistant.)
Also for me the solution of @ts solved the problem
sudo apt install ffmpeg -yAfter a reboot the remote camera video is workingSame here, running last HA in venv on fedora
Started after adding Ring integration (which has the camera, but also declared as not working for realtime stream)
Tried the solution of @supersjimmie but didn’t worked for me.
Solved as @ts suggested, by installing ffmpeg manually before opening the venv.
Yes, I could install ffmpeg, but the point is that we have no need for ffmpeg in our systems. We are not doing any video processing.
Why is HA trying to run ffmpeg? Rather than installing ffmpeg, we would prefer to understand why HA is trying to run it, and preferably not have it run due to fixing some bug, or removing/configuring some add-on that is requiring it but did not install it or tell us it was required.
I was getting
Error starting FFmpegon macOS installed into a virtualenv. I had ffmpeg installed via homebrew and ended up changing my config to point to the actual binary and not the symlink that is in/usr/local/bin/ffmpeg. So here is what I added to myconfiguration.yaml:Now I’m not seeing the error anymore, but this will break next time I upgrade my ffmpeg via homebrew.
I had the problem on my mac too. When I opened /usr/local/bin/ffmpeg in finder so that I could make it trusted by my mac it worked after that.
When starting homeassistant via launchctl it still gives error but works when starting with hass command directly.
This is … unexpected. Is there a documentation reference? Core
hassdepending onffmpegis either a new requirement (and if so, fairly non-standard, why should core Home Assistant requireffmpeg?), OR a component has required it and not properly defined it as a dependency in the manifest.Also whatever code that relies on this should guard against not having a dependency and gracefully log.
EDIT: also there are plenty of components that can define a dependency
Please re-open the ticket. @pvizeli