HomeBridge (or Surveillance Centre) & HKVision Cameras on NVR

Currently reading
HomeBridge (or Surveillance Centre) & HKVision Cameras on NVR

687
226
NAS
DS918+
Operating system
  1. macOS
Mobile operating system
  1. iOS
Last edited:
A bit off topic but Homebridge is running on my NAS. So..........
  • I've installed HomeBridge (non-docker version) on my NAS and it's working well. So far I've got it integrating my ADT alarm system (alarmdot.com), Sky Q box, Sony Bravia TV, so I know it is all working.
  • I've installed the FFmpeg package on the NAS.
I'm the HIKVision system runs on an NVR with the cameras running on their own network controlled by the NVR. The first thing it looks like I need to ascertain for each camera it's address in the format of : -i rtsp://username:[email protected]:554
I'll be damned if I can find that information anywhere either within the iVMS 4200 app or in the HIKVision Web GUI.
I know the same data would be needed to add a camera into a Surveillance Station so I'm hoping some kind soul on here might know how to access the information?
 
Further to this I've found some of the camera data and have looked to add a camera into SS:
Screenshot 2022-09-11 at 13.58.31.jpg


Alas when I try to authenticate it I get:

Screenshot 2022-09-11 at 13.58.45.jpg


This is likely as my main network is 192.168.1.xxx and the cameras are on a network run by the NVR which is 192.168.254.xxx. I guess I need to find a way of allowing the connection between the two. I'm wondering is a static route of some sort is needed on the router?
[Mutters - I wish I understood networking better]......
 
I've added a static route for one of the cameras:
and turned ONVIF on in the NVR settings, that allows SS to see things, but it only sees the NVR nor individual cameras:

Screenshot 2022-09-11 at 16.41.55.jpeg


Screenshot 2022-09-11 at 16.44.19.jpeg

Plus even if I looked to accept that and authenticate that as a camera nothing will authenticate. I even added a user to the ONVIF section of the NVR config and tried that, still no go...
 
Last edited:
Right I've managed to move this on:
  • Went into the NVR and turned on ONVIF and Virtual Machines
  • Turning on Virtual Machines gave me a logon for each camera similar to: http://192.168.1.XX:65001
  • Going to that URL and logging in with the ORIGINAL credentials used by the installer allowed me to access a camera and set up a new user account for it.
  • This then allowed me to set it up in SS on the NAS:
Screenshot 2022-09-13 at 17.03.53b.jpg

This camera can now be accessed via DS Cam on the iPhone, and as an added bonus has sound which the HIKVision app doesn't!

The issue I've now got it to get it into Homebridge on the NAS.

I've searched though all the Homebridge plugins available looking under HikVision and CCTV and tried all the plugins available. Some are NVR based others look to connect to the cameras directly. None of the NVR based plugins work, neither do most of the camera based ones.

The one which has the most promise is the 'Homebridge Camera FFmpeg' plugin, but when configured:

SCR-20220913-qrd.jpg

It shows the camera / speaker in Homebridge but in the 'Home' app on iOS it says device not responding....
Nothing I change seems to make any difference.
 
Okay I'm back from a weeks holiday..... so I can move this on. I did get a camera linked to Surveillance Station and that is working perfectly. After a lot of testing I managed to work out the correct RTSP URL which will display the stream in VLC

Code:
rtsp://<NVR IP ADDRESS>/Streaming/Channels/101/

Where the 101 denotes the camera stream and image. However each time I try to use that within Homebridge (native on the NAS, not within Docker), I get error messages such as:

Code:
[Drive Cam FFmpeg Stream 102] FFmpeg exited with code: 1 and signal: null (Error)

I do have the FFmpeg package running on the NAS. So I'm wondering if the issue is that Homebridge can't communicate with FFmpeg and so gives the error?
Is this likely, if so do you think I'd make progress moving on to (very reluctantly) using Docker and Homebridge / FFmpeg with the same system?
Any thoughts appreciated guys.
 
I've not made any progress with getting the camera to appear in Homebridge at all on the NAS using the standard Synology Homebridge package.

So I've gone down the route of installing Docker (cough spit) using this tutorial, and I'm sad to say I get similar error messages after I install the various plugins and look to access the camera:

[9/26/2022, 3:18:57 PM] [Camera FFmpeg] [Drive Cam (102)] Failed to fetch snapshot.
[Drive Cam (102)] Snapshot request handler provided empty image buffer!
[9/26/2022, 3:18:59 PM] [Camera FFmpeg] [Drive Cam (102)] Starting video stream: 800 x 600, 25 fps, 299 kbps (AAC-eld)
[9/26/2022, 3:18:59 PM] [Camera FFmpeg] [Drive Cam (102)] FFmpeg exited with code: 1 and signal: null (Error)
[9/26/2022, 3:18:59 PM] [Camera FFmpeg] [Drive Cam (102)] Stopped video stream.
Which tells me that I've still got issues with FFmpeg. Now I know I have FFmpeg installed as a package on the NAS, but it looks like I will / may need it in Docker as well. The issue is I can't find any instructions (that I can understand) on how to install FFmpeg in docker. The most comprehensible set of instructions I've found are these, but are meaningless to me :)

Help!!
 
Well to finish the thread off guys the steps top get the cameras working were:
  • Migrate Homebridge to Docker instead of using the native synology package
  • When adding homebridge into docker include FFmpeg as part of the install script
  • The only plugin which worked was The Homebridge Camera FFmpeg (homebridge-camera-ffmpeg v3.1.4)
The json config for the plugin was
{
"name": "Camera FFmpeg",
"cameras": [
{
"name": "Drive Cam",
"manufacturer": "HIKVision",
"model": "DDS-2CD2087G2-L(U)",
"motion": true,
"unbridge": false,
"videoConfig": {
"source": "-i rtsp://<useraccount>:<userpwd>@<nvr IP address>/Streaming/Channels/101/",
"maxWidth": 800,
"maxHeight": 600,
"maxFPS": 25,
"mapvideo": "102",
"audio": true
}
}
],
"_bridge": {
"username": "0E:D5:A4:AC:38:BD",
"port": 55198
},
"platform": "Camera-ffmpeg"
}
The result though:
SCR-20220927-gc0.jpg

I only added the one camera as it really slowed down the speed of my NAS. If I ever look to moving Homebridge to a Raspberry Pie I may revisit it all :) At least I worked the project through to completion.
 
In the end I did manage to both HIK Vision cameras I wanted to use working in Homebridge....

IMG_1138.jpeg


but that took the NAS CPU load from 13% to 67%. So the project is shelved until I can invest in a Raspberry Pie to take the load off the NAS. At least if / when I go that route I have all the configurations saved out.
 
Hi there. I am having the same issues. I am trying to get my Hikvision (7 x cameras) running on Homekit using homebridge on my Synology NAS. Homekit 'sees' the cameras but fails to stream showing a FFmpeg exited with code: 1 and signal: null (Error).
You seem to have got it working. What exactly did u do / use? Any help appreciated. Many thanks
 
If it helps this is the config I use for two cameras. This is using the 'Homebridge Camera FFmpeg (homebridge-camera-ffmpeg v3.1.4)' plugin:

Code:
{
    "name": "Camera FFmpeg",
    "cameras": [
        {
            "name": "Drive Cam HB",
            "manufacturer": "HIKVision",
            "model": "DDS-2CD2087G2-L(U)",
            "motion": true,
            "motionDoorbell": true,
            "unbridge": true,
            "videoConfig": {
                "source": "-i rtsp://user:pwd@<NVR IP ADDRESS>/Streaming/Channels/102/",
                "stillImageSource": "-i rtsp://user:pwd@<NVR IP ADDRESS>/Streaming/Channels/102/ -vframes 1 -r 1",
                "vcodec": "libx264",
                "maxStreams": 2,
                "maxWidth": 640,
                "maxHeight": 480,
                "maxFPS": 15,
                "audio": false
            }
        },
        {
            "name": "Patio Cam HB",
            "manufacturer": "HIKVision",
            "model": "DDS-2CD2087G2-L(U)",
            "unbridge": true,
            "videoConfig": {
                "source": "-i rtsp://user:pwd@<NVR IP ADDRESS>/Streaming/Channels/302/",
                "stillImageSource": "-i rtsp://user:pwd@<NVR IP ADDRESS>/Streaming/Channels/302/ -vframes 1 -r 1",
                "vcodec": "libx264",
                "maxStreams": 2,
                "maxWidth": 640,
                "maxHeight": 480,
                "maxFPS": 15,
                "audio": false
            }
        }
    ],
    "_bridge": {
        "username": "0E:E6:87:8F:97:98",
        "port": 54692
    },
    "platform": "Camera-ffmpeg"
}

This is using HomeBridge within Docker.
 
Well after a bit more tuning I'm running Homebridge for bringing the ADT System into Home which gives me access to the ADT triggers (motion, doors, disturbed windows, etc). These I can now access via the Homekit system to run automations and macros.

I've reconfigured the cameras in Homebridge to use a low-res feed from the NVR which allows visibility on the Home app and the watch without stressing the NAS or the network.
Watch Cam - 1.jpeg


Finally, I've now worked out how to generate a high-res feed for viewing the cams via VLC without stressing the system. Primarily used for watching out for delivery drivers etc. This is a lot easier than using the HIKVision app (which is flipping useless on the Mac) or viewing via the NAS Surveillance Station system (which is now disabled).

As you can see the Homebridge / NAS load is low - while viewing cameras on the iPhone, the Ultra and via VLC :)

Screenshot 2022-10-13 at 08.55.23.jpeg



That means the Homebridge project is complete (for now at least). I know there's not that much interest on the forum as to what I've been doing, but it's good to close another project out. :)
 
I did move this forward a little (lot), in the end I resolved the ffMPEG issues that stopped the native homebridge package working. This meant I could get rid of Docker and run it natively. Again it lowered the CPU usage. So very happy.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top