RING error: FFmpeg fails expected str, bytes or os.PathLike object, not bool

Hello

I am running HA in a venv (HA 0.103.5 (latest), Python 3.7.3 and FFmpeg 4.1.4.1)… I am getting a lot of error messages about RING… Anyone has the same issue ? (I know this issue is exist for a while but as far as I know it has been fixed in a previous version of HA). Other camera’s are working just fine, just Ring having the problem. Any help will be much appreciated.

Here are my error messages:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/haffmpeg/core.py", line 136, in open
    self._proc = await self._loop.run_in_executor(None, proc_func)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1453, in _execute_child
    restore_signals, start_new_session, preexec_fn)
TypeError: expected str, bytes or os.PathLike object, not bool
2020-01-03 17:51:51 WARNING (MainThread) [haffmpeg.tools] Error starting FFmpeg.
2020-01-03 17:52:12 ERROR (MainThread) [haffmpeg.core] FFmpeg fails expected str, bytes or os.PathLike object, not bool
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/haffmpeg/core.py", line 136, in open
    self._proc = await self._loop.run_in_executor(None, proc_func)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1453, in _execute_child
    restore_signals, start_new_session, preexec_fn)
TypeError: expected str, bytes or os.PathLike object, not bool
2020-01-03 17:52:12 WARNING (MainThread) [haffmpeg.core] FFmpeg isn't running!
2020-01-03 17:52:12 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/view.py", line 123, in handle
    result = await result
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 496, in get
    return await self.handle(request, camera)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/camera/__init__.py", line 531, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/ring/camera.py", line 152, in handle_async_mjpeg_stream
    stream_reader = await stream.get_reader()
  File "/srv/homeassistant/lib/python3.7/site-packages/haffmpeg/core.py", line 181, in get_reader
    lambda: reader_protocol, self._proc.stdout
AttributeError: 'NoneType' object has no attribute 'stdout'
2020-01-03 17:52:15 ERROR (MainThread) [haffmpeg.core] FFmpeg fails expected str, bytes or os.PathLike object, not bool
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/haffmpeg/core.py", line 136, in open
    self._proc = await self._loop.run_in_executor(None, proc_func)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1453, in _execute_child
    restore_signals, start_new_session, preexec_fn)
TypeError: expected str, bytes or os.PathLike object, not bool
2020-01-03 17:52:15 WARNING (MainThread) [haffmpeg.tools] Error starting FFmpeg.
2020-01-03 17:54:29 ERROR (MainThread) [haffmpeg.core] FFmpeg fails expected str, bytes or os.PathLike object, not bool
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/haffmpeg/core.py", line 136, in open
    self._proc = await self._loop.run_in_executor(None, proc_func)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1453, in _execute_child
    restore_signals, start_new_session, preexec_fn)
TypeError: expected str, bytes or os.PathLike object, not bool
2020-01-03 17:54:29 WARNING (MainThread) [haffmpeg.tools] Error starting FFmpeg.

Usually that error means ffmpeg isn’t installed.

Try a sudo apt-get install ffmpeg

Thanks for the tip but I checked the version of ffmpeg in the venv and out of that environment and it is 4.1.4.1 on both…
So ffmpeg is installed… I ran also the upgrade command for ffmpeg but I have the latest version…

Reading package lists... Done
Building dependency tree       
Reading state information... Done
ffmpeg is already the newest version (7:4.1.4-1+rpt1~deb10u1).
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

What concerns me is the error message mentioning “FFmpeg”… The two first letters are capitalized and I know Raspbian is sensitive to upper/lowercase…

If you do a which ffmpeg it comes up with a path right?

Yes:

/usr/bin/ffmpeg

I wondering: maybe some missing codecs is causing the problem ?

Could be, try installing i think the x264 codec from apt libavsomething as well I don’t recall the name off hand.

Just to be sure, I rebooted the Raspberry… and now it is working again… Not sure what was blocking maybe the last update to the OS I made before moving to HA 0.103.5… Frustrating…