Installing ffmpeg package into hassio

Hello, is there any way to install ffmpeg into my hassio container?

Hm could be that I actually have ffmpeg allready, tried ffmpeg in the hassio terminal, but now I understand that this is actually not in the container?

Anyway what I try to do is taking a snapshot when a sensor is triggered, now I have a bash script insisde hassio that I call from node-red, Is this a viable way of doing this? it’s really different using containers

Just add this to your configuration.yaml file and restart.

ffmpeg:

See:

1 Like

Oh that was easy, it works now. Thank you

Also to get it to work
I had to call a function inside hassio from node-red which runs the script, so I could not call the bash script directly from node-red, I’m guessing it’s because hassio and NR is different containers?

1 Like

:man_shrugging: I don’t use node-red.

Try asking in the node-red forum category. Give plenty of details about the function and script.

Hi @andersB!

I know this is a really old thread, but did you ever got any further with it? I am looking for exactly the same thing (invoke a bash script containing a ffmpeg commando, from node-red).

1 Like

Did you find a way to do this?

Depends what you are trying to do - if you want NodeRed to run the command inside the node-red container, then you need to add ffmpeg to the node-red container. If NodeRed is just asking Home Assistant to run the command - then it needs to be in the Home Assistant container.

Basically I have Home ASsistant OS installed on a raspberry Pi 4 8g Ram.
I installed Node-Red as an add-on in HA

I added to configuration.yaml:
ffmpeg:
so I can record a mjpeg camera stream with a command_line switch (this is how i know its working)
But that´s not how i want to do the workflow, i’d rather have a node in node-red that can call the same command as i am doing in HA.
I’ve tried Exec node, but it says:

ffmpeg: command not found

I also went into HA CLI or command line through SSH and tried to run the ffmpeg command and the same thing happened, it does not work…

I dont know what i’m doing wrong, or the way to aproach this.

Right, but do you want the recording to be made INSIDE NodeRed or do you want NodeRed to call a service in Home Assistant to handle making the recording?

The CLI won’t find the command, because it is a container all on it’s own.

EDIT:

If you absolutely want ffmpeg to be available inside the NodeRed container, then pop to the configuration tab for the NodeRed addon and find the system_packages option, and add:

 - ffmpeg
2 Likes

That was exactly what I wanted to do.

1 Like

As an aside, if I want to use ffmpeg in a sh script that’s called by something in HA, I need access to ffmpeg. It’s not in /usr/bin and not in the path. Is there any way to do this with a locked down HAOS?

I don’t know is the only answer I can give. I know you can login to the HASSOS file system (by typing login at the prompt) and then add ffmpeg using apk add but I don’t think the changes persist OS updates.

Because HomeAssistant itself is a docker container, then ffmpeg is installed INSIDE the Homeassistant container and is not available outside it in the host. Technically at least.

Entering the Homeassistant docker container docker exec -it homeassistant /bin/bash and then running which ffmpeg returns the path as /usr/bin/ffmpeg

Hope that helps.