Automation of ffmpeg task using hassos

Hi,

I recently migrated to using the hassos installation of home assistant. I used to have a a process running on my old server that would run a bash script every 24 hours to generate a video from still photos that have been gathered during the day.

Now that I’m using hassos, I can’t find a way to implement the bash script to perform this task. Could someone point me in the right direction, if there is one, so I can have my new install perform this task? I’m looking for a way to trigger the following commands (currently a cron job triggering a bash script):

today=$(date '+%Y%m%d')
yesterday=$(date -d yesterday '+%Y%m%d')
cat /home/pi/homeassistantmedia/images/$yesterday*.jpg | ffmpeg -y -f image2pipe -framerate 10 -c:v mjpeg -i - /home/pi/homeassistantmedia/videos/$yesterday.mp4

I figured this out myself, once I found the shell_command integration :slight_smile:

I hope you can help he. I’m trying to record my rtsp feed with ffmpeg. I use this code

start_ffmpeg_recording: ‘ffmpeg -i rtsp://USER:[email protected]:554 -t 00:00:30 -c copy /config/www/output.mp4’
stop_recording: ‘pkill ffmpeg’

And get this error message

Error running command: ffmpeg -i rtsp://USER:[email protected]:554 -t 00:00:30 -c copy /config/www/output.mp4, return code: 8

NoneType: None