Short story: My end-goal is to figure out the least expensive way to put a CCTV camera image on a TV screen. After trying the RTSP route, I wan't happy with the delay in pulling a camera image. My attempt now is to route the HDMI from the NVR to a TV. One option would be to use a HDMI -> HDTV encoder which would put the NVR on all TVs via COAX or via HDHomerun. Option 2 would be to use the BlackMagic ATEM Mini to have multiple HDMI sources run directly into the indigo Mac and stream out via RemoteSight or SecuritySpy. #2 sounds really fun and cheeper than the encoder option, but will have the same RTSP streaming lag issue that got me here.
Step 1: Figure out which channel, mode and group to use: (I did this experimenting on google chrome browser before putting in as a script on Indigo)
Note: I'm not sure if I was running into a max-user thing on the NVR. (versus a camera, an NVR may only allow a user to access the NVR in one instance only.). So, on the NVR, I created a "Indigo" account with it's own password)
Format from API:
- Code: Select all
http://<server>/cgi-bin/split.cgi?action=getMode&channel=<ChannelNo>
example from API:
- Code: Select all
http://192.168.1.108/cgi-bin/split.cgi?action=getMode&channel=1
What worked for me:
- Code: Select all
http://user:password@192.168.1.108:8018/cgi-bin/split.cgi?action=getMode&channel=0
When I tried "channel=1" I got an error. When I tried "channel=0", it returned information.... a list of channel, modes and groups.
Now the command to change the screen...
What worked for me (Single camera on the monitor):
- Code: Select all
http://user:password@192.168.1.101:8101/cgi-bin/split.cgi?action=setMode&channel=0&mode=split1&group=0
What worked for me (8 cameras on the monitor with 1 large camera image)
- Code: Select all
http://user:password@192.168.1.101:8101/cgi-bin/split.cgi?action=setMode&channel=0&mode=split8&group=0
For me, channel is always "0". "split1" is a single channel on the screen. "group=0" is camera #1 on the NVR. (Camera # on the NVR -1 = group #)
"split8" is the 8 camera view with 7 small windows and one larger window. The larger window in the above is Camera #1 on the NVR, "group=0"
So, if there is motion at my driveway, I can "mode=split8&group4" which will bring up the 8 camera view with camera #5 (my driveway camera) as the big camera image.
For a 4-way split.... if you have 16 cameras, group=0 will be the first 4 cameras. group=3 will be cameras 13,14,15,16 on a 4-way split.
Once you figure out what commands are working with your NVR, now it's time to make the action commands to control. I have an 8 channel NVR that I'm setting up for this, so I created 16 actions. One action for each split1 per camera. One action for each split8 with a focus on each camera.
This is what I put in an action with a python script (changing the mode and group for each action).
- Code: Select all
import requests
url = 'http://user:password@192.168.1.101:8101/cgi-bin/split.cgi?action=setMode&channel=0&mode=split1&group=0'
reply = requests.get(url)
reply.raise_for_status()
I hope others find this helpful.