Yi component "Image not available"

Also, i noticed that ffmpeg is installed in /home/pi/ffmpeg - is that an issue?

EDIT: I just tried it with sudo and it didnt error, but it didnt do anything else either, just gave me a new line on the cmd line…

sudo ftp://****@192.168.0.29:21/tmp/sd/record/2018Y01M27D19H/30M00S.mp4

If that ffmpeg command runs as root but errors as the HASS user, then it’s likely you have a permissions error somewhere.

Im pretty sure i gave the HASS sudo permissions trying to get something else to work. In fact, i did it was for ps4-waker, i needed to run it as sudo in the end.

Any other suggestion?

Can you tell me what script runs this cmd in the homeassistant/pi structure so I can put sudo in front of it?

It’s not a script. It’s the Yi component which is written in Python. Fairly certain those components cannot be executed directly.

My first guess with a successful ffmpeg with sudo is that the user you were running it as did not have the necessary privileges somewhere in the chain.

Maybe instead of running that ffmpeg command on the FTP file, download the file to the HASS directory and run the command on that. Do not download it to your PC and then push it to HASS. Actually go in the directory and grab it from command line.

wget --user=NAME --password='PASSWORD' ftp://192.168.0.29:21/tmp/sd/record/2018Y01M27D19H/30M00S.mp4
ffmpeg -i 30M00S.mp4 -an -frames:v 1 -c:v mjpeg -f image2pipe -

Right that command worked and downloaded the file to the directory - i had to run it as sudo though as got permission denied without it.

I then pointed the first script at the downloaded file, ran it without sudo and got illegal instruction again:

ffmpeg -i 30M00S.mp4 -an -frames:v 1 -c:v mjpeg -f image2pipe

…but works with Sudo…!!!

Yes, this is totally a permissions issue. Sounds like your ownership of the directory structure is off. What user is HASS running as? And you are executing these commands as that user?

For me, I login as pi. But HASS is actually running as homeassistant. So before I try this stuff, I have to

sudo su homeassistant

Ive logged in as pi via ssh and ran all the commands above as this user.

Ive also just run that command which logged me in as the homeassistant user.

Any other suggestions? I appreciate your help so far matey,

You need to try all of the troubleshooting steps as the homeassistant user since that is the account that is executing the services. Of course they all failed as the pi user as that user does not have the appropriate permissions to the homeassistant directory.

i installed it as the pi user, would that be in the issue?

If i reinstall ffmpeg as the homeassistant user would that work? I get illegal operation even when i write ffmpeg.

Which user has ownership of the HASS configuration directory. I believe mine is /home/homeassistant and owned by homeassistant.

mine is owned by homeassistant aswell

drwxr-xr-x 5 homeassistant homeassistant 4096 Jan 20 02:10 homeassistant
drwxrwxrwx+ 17 pi pi 4096 Jan 29 17:23 pi

All troubleshooting 100% needs to be done as the homeassistant user.

Installing libraries/ffmpeg as different users will not change anything, and likely wouldn’t even install.

Anyone know how to make it work? add the ln into root directory and still getting the error… Unsure how to make it work… Help? Do I need to install ffmpeg on my hassbian to make this work…

Yes you do. It’s says above how.

Iv given up which isn’t like me. The homeassistant user doesn’t have permission to run ffmpeg in my scenario.

Hi Rich_Paul I believe you used hassio which in this case nothing much you can do since its being setup very close as standard only. Even using SSH doesnt do much since your SSH wont give you any root access whats so ever. However if you used Hassbian like in my case, its pretty simple since installing ffmpeg is so easy.

However my question to everyone, why I can only see the picture and not a playing video. Should I want to see it moving video is there away to do it?

I’m using hassbian like you. I think my permission may are screwed.

Could I use a cmd_line switch and just pass the ffmpeg command through that, with sudo at the start. Then an automation to run that when I need?

Heemm unsure why you are having the problem. I’m using apt-get install ffmpeg and it works like a charms. ffmpeg doesnt need sudo as far as I know, so its easily being called by homeassistant user.

Anyway did you still running jessie or strecth? Anyway please let me know how I can assist?

I run Hass.io 0.64.3 on my RPi 3 and get Camera: Image not available on frontend.

What I did:

  1. SSH’ed to RPi and issued ln -s /tmp tmp
  2. added the following to my configuration.yaml
    ffmpeg:
    ffmpeg_bin: /usr/bin/ffmpeg

camera:

  • platform: yi
    name: Camera
    host: ‘192.168.0.40’
    password: 1234
    path: /tmp/sd/record
    ffmpeg_bin: /usr/bin/ffmpeg
    ffmpeg_arguments: ‘-vf scale=800:450’
  1. Changed PureFTPd to ftpd as per instructions here

Still get the same message instead of picture/video.
System logs contains no errors.
How to troubleshoot it?

Your problem is that you SSHed into the RPI and made a symlink. You have to do that on the camera, not the RPI.