Closed bachya closed 5 years ago
I think your command argument will parse as bool and not as string. That was also your problem before...
This is a boolean?
ffmpeg_arguments: '-vf scale=800:450'
Maybe a trouble inside component? I can only say that I become a boolean instead a string to ffmpeg-ha library
Maybe I can help me to find the problem?
Happy to help in any way I can! As I mentioned in my previous bug, I'm dealing with raw MP4s, so if sending you one of those would help, I can certainly do that.
I am also seeing these errors:
FFmpeg fails program arguments must be a bytes or text string, not bool
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/haffmpeg/core.py", line 114, in open
stderr=stderr
File "/usr/lib/python3.6/asyncio/subprocess.py", line 225, in create_subprocess_exec
stderr=stderr, **kwds)
File "/usr/lib/python3.6/asyncio/base_events.py", line 1182, in subprocess_exec
% type(arg).__name__)
TypeError: program arguments must be a bytes or text string, not bool
My entire config is here. I am using Hikvision and Bloomsky cameras. I don't have any arguments specified for ffmpeg. Let me know if I can provide any more details.
I'm having the same problem with Ring Doorbell camera:
2017-11-19 10:34:06 ERROR (MainThread) [haffmpeg.core] FFmpeg fails program arguments must be a bytes or text string, not bool
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/haffmpeg/core.py", line 114, in open
stderr=stderr
File "/usr/lib/python3.5/asyncio/subprocess.py", line 212, in create_subprocess_exec
stderr=stderr, **kwds)
File "/usr/lib/python3.5/asyncio/base_events.py", line 1070, in subprocess_exec
% type(arg).__name__)
TypeError: program arguments must be a bytes or text string, not bool
2017-11-19 10:34:06 WARNING (MainThread) [haffmpeg.tools] Error starting FFmpeg.
Ok,
I've figured out what was going on in my case. Here it is:
ring
camera component for HA was passing False
as input_source
to open()
function:
def open(self, cmd, input_source, output="-", extra_cmd=None,
stdout_pipe=True, stderr_pipe=False):
"""Start a ffmpeg instance and pipe output."""
stdout = asyncio.subprocess.PIPE if stdout_pipe\
else asyncio.subprocess.DEVNULL
stderr = asyncio.subprocess.PIPE if stderr_pipe\
else asyncio.subprocess.DEVNULL
if self.is_running:
_LOGGER.warning("FFmpeg is allready running!")
return
# set command line
self._generate_ffmpeg_cmd(cmd, input_source, output, extra_cmd)
....
Hence self._generate_ffmpeg_cmd()
generated a parameter list with False
in it. Here is my list for example:
['ffmpeg', '-i', False, '-an', '-frames:v', '1', '-c:v', 'mjpeg', '-f', 'image2pipe', '-']
And this caused the problem in asyncio.create_subprocess_exec
as seen in the stacktrace earlier.
@pvizeli do you think it will be better to check for valid parameters and maybe throw more meaningful exception? I'm pretty sure others here have similar issues: the modules they use pass invalid parameter for input_source
In the latest release of HASS, I'm getting this unhandled exception:
I'm using Arlo Cameras and a Yi Camera. Let me know if you have any questions.