Hey did you have any progress on this? Currently don’t have the hardware to do motion detection through frigate but would love to leverage existing swann motion detection alert and use them as triggers in home assistant
Sadly I got bad news🥲. Of course swann disabled it lol. I tried all the endpoints I could and I’m pretty sure they outright disabled it. I can send you the documentation so you can have a look if you want? I’m using frigate (albeit with my cpu since corals are impossible to get) and it’s been working well for me. There’s a dvr info endpoint that you can call and it will tell you if motion is currently detected but home assistant has to constantly call the endpoint.
Aah damn, no worries, thanks for looking into it. Yes can you send me the docs please. Yeah but running frigate on a pi with 4 cameras is probably too much haha.
Here they are. What kind of Swann DVR/NVR do you have. Specifically what year? Newer ones are made by an OEM named Raysharp but the some of the older ones are made by Hikvision. The docs are in Chinese and sometimes hard to understand because google translate lol.
I put them in this GitHub repository. They’ll be uploaded in a few, just have to setup the repository. I also put the sdk in there so that can be picked apart possibly.
Ok, I just uploaded them all so go have a field day lol!
I had an older model Swann DVR (srdvr-84500h). The Hikvison directories worked for me:
rtsp://[User]:[Password]@x.x.x.x:554/Streaming/Channels/[C]0[S]
[C] is camera channel
[S] is Main Stream “1” or Sub Stream “2”
camera:
- platform: ffmpeg
name: CCTV Front Door
input: rtsp://user:[email protected]:554/Streaming/Channels/101
Hope this helps those with older models.
I’ve been getting this error for a few weeks now and just tried this for my 2 Hikvision Colorvu cameras but still getting the same error
I the same DVR as you I believe: DVR8-4580G which I think is a recent one because the Raysharp API you gave works with mine (only tested with the get information protocols for now - didn’t want to break something by setting something incorrectly).
The only thing I am doing that might be unusual is using port 85 (default port instead of port 80 for http access) and using basic authentication in curl… here’s a verbose dump from CURL for example (passwords etc redacted):
curl -v http://192.168.20.108:85/action/getNetConfig?name=RTSP --basic -u admi
n:password
* Trying 192.168.20.108:85...
* TCP_NODELAY set
* Connected to 192.168.20.108 (192.168.20.108) port 85 (#0)
* Server auth using Basic with user 'admin'
> GET /action/getNetConfig?name=RTSP HTTP/1.1
> Host: 192.168.20.108:85
> Authorization: Basic XXX
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< X-Content-Security-Policy: default-src 'self'
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< Strict-Transport-Security: max-age=315360000; includeSubDomains
< Content-Length: 118
< Connection: keep-alive
<
RTSP.UserName=admin
RTSP.Password=password
RTSP.Port=554
RTSP.CheckFlag=1
RTSP.Switch=1
RTSP.AuthType=1
* Connection #0 to host 192.168.20.108 left intact
Most of the information in that API doesn’t appear useful and it does report some incorrect items e.g. the interface states that FTP is enabled but the port is closed (and thank god it is because it comes preconfigured with the default password). The box itself runs some form of customised linux from what I can see so I’m guessing that the service is still running but the device firewalls the port to refuse all connections.
By the way the password was stored in that field in plain text - but I guess you need the password to get the password.
Edit: Would be interesting to see if we can get an API on the port 9000 protocol. This seems much more relevant because it grants the ability to adjust camera motion detection sensitivity and disable PIR and motion detection. It’s running on a webpage (right click on the Swann Security window) which is served up locally by QtWebEngineProcess.exe locally. All communication is TCP traffic on port 9000 but using wireshark doesn’t get me anywhere it looks like a bundle of garbage.
For those having trouble getting this working see my next post below. I started editing then the edit got massive.
For those who:
- have sluggish performance
- have disabled the stream: integration by removing default_config:
This may be because your camera is re-encoding the video from H265/HEVC (check by opening the stream in your video player of choice e.g. VLC). FFMPEG is trying to re-encode the stream for viewing but doing that on my RPi400 overworks my poor little CPU. This won’t be an issue if you are running on more powerful hardware (or have fewer cameras) and may explain why some users experience problems and some users don’t.
To get it working for me I have:
- disabled the stream integration and use another method
- switched the stream to H264
1 - Disable Stream Integration
I have disabled the stream integration because it degrades performance - it retrieves the stream, re-encodes it then passes it on. I had huge buffering issues with this even when on the same network. Instead, I am using AlexxIT/WebRTC which passes the stream on using WebRTC (peer 2 peer traffic I believe).
2 - Switch the stream to H264
In order to use the WebRTC method above, the stream must be encoded in H264 - H265 isn’t supported at this stage.
In order to do this, I downloaded the Swann Security VMS software (not HomeSafe View). This software looks like it’s designed for security companies to use but handily exposes much more configurability than any other method. Once you have installed Swann Security:
- Setup your account (if you plan on deleting the software after this doesn’t need to be a secure password).
- Login and upon logging in you should be presented with a grid of 9 grey squares.
- I was confused by this too and assumed the software wasn’t working but in the top-left there is an icon of a house with a circle in it - click that.
- Select Device Management.
- Select “Auto Search” at the top it will (hopefully) find your system and you can select it and press add in the bottom right.
5a. If you know your systems settings, you can manually add from the All equipment screen by clicking the + in the top right. - Go back to the All equipment screen (top left).
- If all went well, your device should be showing and a green light should be showing in the status column. If not, you probably got your password wrong (edit by clicking the pencil symbol).
- Enter the management interface by clicking the cog.
- Select Record on the left and then select MainStream
- Change Video Code Type to H264 from H265.
10a. (Optional) You can turn off the camera name watermark on the Display → Live screen. You can also use this interface to remove the timestamp or, move it to a more convenient location that is less likely to block something important (drag the red bounding box). Don’t forget to save. Don’t worry if you’ve turned off name and it’s still showing on this screen - it won’t show on your stream or recordings anymore.
10b. (Optional) You can turn off the Swann watermark in System → General and toggle the watermark. Handy to get rid of that water mark which again might obscure something.
Would be interesting to see if we can get an API on the port 9000 protocol.
Yeah I would love if this could work but I am not advanced enough to figure it out by myself lol. In the GitHub repository I also included the raysharp sdk which is what I assume the Swann app is built off of. I looked in that code and there is some interesting lines but I don’t know how to get it working. Thanks for your replies as well! I didn’t know Swann VMS was a thing!
I am running:
Camera Model : NHD-887MSFB
Swann Security System: NVR-8580
I have integrated them into HA via an RTSP stream to Frigate NVR running on HassOS
What integration are you using?
At this point I’m currently using Frigate since it just works. It would be possible to build a native Swann integration but that would require a lot of reverse engineering the protocol that the app Swann app uses (I’m pretty sure in my GitHub repository there is an sdk for this api but I’m not sure since there was basically no documetation)
I am using frigate too, but would love to have a swann integration
Any updates?
Running HA on a Raspberry Pi 400 and using the HD stream set as zero was not working. I switched to SD stream set to 1
Works great thank you
This worked for me. I have NVR8-4900 with 8 channels.
FYI to go to other channels go to 101, 201, 301 e.g.
rtsp://admin:[email protected]:554/Streaming/Channels/1 - 9 panel
rtsp://admin:[email protected]:554/Streaming/Channels/101 - basement
rtsp://admin:[email protected]:554/Streaming/Channels/201 - backyard
Also found this by searching here:
https://www.ispyconnect.com/camera/swann
and tested via VLC → Media → Open Network Stream
Hi all,
I’ve recently purchased a SWIFI-2KOCAM and am trying to get it going under Frigate.
I already have a SWIFI-SPOTCAM which works fine.
I think I have the wrong codec as I can’t get the stream to work in HA.
I’ve copied the config from my SPOTCAM for my 2KOCAM without success.
I have - path: rtsp://admin:[email protected]:554/ch01/0
configired for the 2KOCAM without success.
Both streams work fine in the SwannCam App.
The stream for the 2KOCAM is a solid green box in HA.
The link “Connect to Swann cameras” doesn’t have the 2KOCAM listed yet…
Anyone know how I might get the right codec/path for the 2KOCAM?
The log states:
[2022-12-27 15:34:32] ffmpeg.swanncam02.detect ERROR : Could not write header for output file #1 (incorrect codec parameters ?): Function not implemented
[2022-12-27 15:34:42] ffmpeg.swanncam02.detect ERROR : [flv @ 0x561ed41d2f80] Video codec hevc not compatible with flv
Apologies, I’m not strong in this space. Hopefully it’s a simple fix?
Any help greatly appreciated.
@geekforlife and @CrouchingWorm Change your codec from H265 to H264 to get the full quality stream working (1080p or 4K depending on your model). The secondary stream is quite low resolution.
I was searching for a proper Swann integration, & like others couldn’t find one, but this is a doddle to setup & works just as well as their mobile app
That is once I’d figured out the rtsp://
url, well the channel bit anyway. I tried with ch01
to start with, & it wouldn’t play in VLC, but on my system it was just ch1
(w/out the zero).
Looking for some help!
I have an Swann model NVR8-7400.
Have tried all the above RTSP streams in VLC and just can seem to get anything to work… Any suggestions (or anyone got the same camera to work?)