Hi @Olivier974
Many thanks for your quick response, I do appreciate it.
As I do not like copy&paste approach without understanding how the things work, you kicked my lazy a$$ to start thinking. It worked.
For those who will be browsing here for some troubleshooting, few remarks from my side:
The problem with my scripts was not the availability of ffmpeg, as I initially thought. The binary is available in the docker. Here I do not know if it is necessary to add the ffmepg: to config or not. According to manual it is: FFmpeg - Home Assistant
In my case HA running the script in docker failed to resolve hostname homeassistant.local: Name does not resolve. Changing the hostname to ip, solved the issue.
The updated and working test script is as follow:
#!/bin/bash
http_url=http://192.168.0.10:8123/api/camera_proxy_stream/camera.my_camera?token=$1
ffmpeg -i $http_url -y -t 5 -vcodec copy /config/cam.mp4
Don’t forget to change the ip to your one.
Now it works perfectly and generates a test recording.
Second remark for troubleshooting your own bash scripts: Add one line to the script as the second line:
#!/bin/bash
exec &>>/config/debug.log
In the config/debug.log you will find some useful information dumped from script execution.
And coming back to Olivier’s remark:
dont forget ; after each end of line script
I have no idea where the ; shall be added, it is apparently not needed. We do execute a regular bash scripts, so semicolon is just a separator of the commands, same a s new line. It is handy if you have more commands in one line (IMHO).
Many thanks for creating this thread and providing great ideas, very useful.
Best
Peter