Is ffmpeg pre-installed on hass.io?

Hi,

As the title says, does hassio come with ffmpeg pre-installed?

I’m running hassio 0.73.2 on Ubuntu 16.04 and when i SSH into hassio (through the SSH - Secure Shell add-on) and run the following command:

ffmpeg -version

…I get this result:

zsh: command not found: ffmpeg

In my configuration I have added this:

ffmpeg:

camera:
  - platform: ffmpeg
    name: House
    input: -rtsp_transport tcp -i rtsp://user:[email protected]/streaming/Channels/1

According to this link, hassio should come with ffmpeg installed and I only need to add ffmpeg to the configuration.

So, if ffmpeg is not installed on hassio, how do I install it?
I can install it on Ubuntu but hassio can’t access that, right?

Thanks!

The SSH add-on is running in a separate container from hassio AFAIK, and you won’t see all the commands available within hassio.

I might be wrong as that might have changed since I messed with it.

I was hoping it should be in this location on hassio:

I understand what you were looking for.

But when you SSH in, you’re not IN the hassio container. You’re in an SSH container. It’s a different container altogether.

Ok! :slight_smile:

What options do I have?
Can I access ffmpeg which I have installed on Ubuntu from the hassio container?
Or can I somehow access the hassio container and install ffmpeg there?

Hi again!

I have solved my problem and it was completely my fault :slight_smile:
Some days ago I created different VLANs for Home Assistant and my cameras och when looking at the firewall log there was some blocking.
Allowed the traffic and everything start working :slight_smile:

So this is what I’m using now and it’s working:

ffmpeg:

camera:
  - platform: ffmpeg
    name: House
    input: -rtsp_transport tcp -i rtsp://user:[email protected]/streaming/Channels/1
2 Likes

My solution to run commands installed on the host and that are not present in the Hassio image. Remember that the Hassio image for Raspberry Pi 4 is based on Alpine Linux. To install a package on Alpine, use the apk command. Example to install ffmpeg on this Linux:

$ apk add --no-cache ffmpeg

I circumvented the problem by running the command via SSH on the host using the “Terminal & SSH” add-on. Configure the add-on, then access the terminal and generate your identification keys:

$ ssh-keygen
(empty for the passphrase)

Then create the directory:

$ mkdir /config/.ssh

And copy the keys there:

$ cp /root/.ssh/id_rsa* /config/.ssh/

Perform an SSH access to your own host to record the data in known_hosts:

$ ssh root@[rasp_ip_address]

Once passwordless access is working, create the command you want to run in configuration.yaml:

   ffmpeg_version: ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' root@[rasp_ip_address] "ffmpeg -version"

Restart Hassio.

Now just invoke the service: shell_command.ffmpeg_version

It’s tedious but it works.

2 Likes

thank you so much - threads and threads and threads for nothing. I could not get ffmpeg integration working (camera was just showing nothing) until I did such. Ultimately ffmpeg is not installed inside hassio.