IP camera under Homebridge using FFMPEG

dlobel

Dabbler
Joined
Feb 19, 2021
Messages
32
Hi there,

I'm trying to get my Hikvision cam (model DS-2DE2A404IW-DE3) running on TrueNAS-12.0-U2.1 under a Homebridge Jail.

The Homebridge jail is working well and I've been able to connect my Ring cams, Nest Thermostat and Tuya light devices. But I can't get the IP Camera to work.

In VLC the RTSP stream is working fine: rtsp://user:passw@192.168.1.64:554/ISAPI/Streaming/channels/101 ... (or substream 102)

When manually installing the FFMPEG plugin, I get an error that FreeBSD X86 is not supported and the I should install/compile manually? Is there anybody who's succesfully running an IP CAM under a Homebridge Jail via de FFMPEG plugin?

For testen purposes, I installed a separate Homebridge on my Mac. In less then 5 minutes I got the Hikvision camera working.
So the Homebridge FFMPEG plugin under FreeBSD is the issue.

Any help will be appreciated!
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
You should be able to install FFMPEG into the jail with :

pkg install ffmpeg
 

dlobel

Dabbler
Joined
Feb 19, 2021
Messages
32
Hi,

As I already stated, I get errors after updating and installing packages, see BOLD message underneath:

root@Homebridge:~ # pkg install ffmpeg
Updating plugin-default repository catalogue...
[Homebridge] Fetching packagesite.txz: 100% 6 MiB 6.5MB/s 00:01

Processing entries: 100%
plugin-default repository update completed. 30178 packages processed.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed

root@Homebridge:~ # npm install -g homebridge-camera-ffmpeg --unsafe-perm

> ffmpeg-for-homebridge@0.0.9 install /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge
> node install.js

ffmpeg-for-homebridge: freebsd x64 is not supported, you will need to install/compile ffmpeg manually.

+ homebridge-camera-ffmpeg@3.1.2
added 94 packages from 56 contributors in 5.46s

And ideas?
 

dlobel

Dabbler
Joined
Feb 19, 2021
Messages
32
Hello,

anyone out there who has a clue what to do?

does anyone use the FFMpeg camera plugin under homebridge ?
 

FrankNAS

Contributor
Joined
Dec 3, 2017
Messages
111
bawhah sounds like my ticket for ffmpeg-static which is used by a few more node packages. I was trying to get my eufy doorbell working.

you can try and open a ticket for them to add support but you will likely get the same response that is basically "we just bundle precompiled binaries"

ps. I built FFMPEG statically linked. it took 3 days :/ wanna try it? I appears to pass all FATE items.
pps. my FFMPEG was built for AMD64 so it wont work on x86 (i386). I didn't even know that people still used i386!

late edit: It does appear that they build FFMPEG and not just bundle it:
also looks like it is detecting x64 (your second post). what is your march? x86 or amd64 (x86_64)? `uname -p`
 
Last edited:

dlobel

Dabbler
Joined
Feb 19, 2021
Messages
32
I have a Intel core i5 9th gen x86 machine running Truenas. On Reddit I got a reply form the "camera ffmpeg" developer sunookitsune (David Maher).
He explained that Camera FFMPEG currently isn't supported on FreeBSD running Homebridge in a mail. While i'm not a developer, I'm not able to get the custom code running on FreeBSD (hence not even compiled ;) ... )

Do you have a simple instruction of how to get the code compiled and running on FreeBSD? or and other advice?
 

FrankNAS

Contributor
Joined
Dec 3, 2017
Messages
111
FFMPEG can be built as a something that is completely statically linked assuming you are not using any of the "non-free" plugins. It took about 3 days of tinkering as almost none of the components can be built without patches under FreeBSD

I think I found the thread you were talking about (https://www.reddit.com/r/homebridge/comments/m0d9tb/hikvision_camera_issue_with_homebridge/). He suggested https://github.com/homebridge/ffmpeg-for-homebridge and the build-ffmpeg script from it. You can give that a try more as a guide than a script. It is full of things that will fail on FreeBSD ( e.g, hardcoded binary locations, assumptions about the build environment)

Interestingly enough, the failure message from that node package will still happen even with ffmpeg installed. The package is failing to install not that it is actually missing ffmpeg (https://github.com/homebridge/ffmpe...1ca5153632d9f5b6c7d7d2f6/install.js#L166-L173)
 

dlobel

Dabbler
Joined
Feb 19, 2021
Messages
32
Hey,

An update from my side: After upgrading the node Package manager (NMP) I got Camera FFMPEG under homebridge installing without any errors. Turned out that my version of NMP was outdated. Therefor the installation of FFMPEG failed every time. Now its running stable and can I enjoy my cameras under Homebridge.
 

FrankNAS

Contributor
Joined
Dec 3, 2017
Messages
111
odd that it was an old version of NPM causing issues and updating it resolved it.

ffmpeg-for-homebridge still does not list freebsd as a supported or detected platform but glad its working!
 
Top