Swann DVR CCTV systems and HA

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 :frowning_face:

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.

2 Likes

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:

  1. disabled the stream integration and use another method
  2. 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:

  1. Setup your account (if you plan on deleting the software after this doesn’t need to be a secure password).
  2. Login and upon logging in you should be presented with a grid of 9 grey squares.
  3. 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.
  4. Select Device Management.
  5. 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.
  6. Go back to the All equipment screen (top left).
  7. 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).
  8. Enter the management interface by clicking the cog.
  9. Select Record on the left and then select MainStream
  10. Change Video Code Type to H264 from H265.
    10a. (Optional) You can turn off the camera name watermark on the DisplayLive 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 SystemGeneral and toggle the watermark. Handy to get rid of that water mark which again might obscure something.
2 Likes

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)

1 Like

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.

2 Likes

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 :star_struck:

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?)

I’m no expert at this and just followed someone elses instructions but I have the same Swann Model and I use this format in my Home Assistant configuration:

rtsp://user:password@address:554/ch03/1

Where user and password are valid on the Swann NVR, and address is its IP address e.g. 192.168.0.44

e.g. rtsp://fred:[email protected]:554/ch03/1

I use ch01 to ch06 as I have 6 cameras but they must match you Swann setup. There is a 0 or 1 at the end to indicate which video feed you want, either SD or HD.

I hope this helps.

Hey, Thx so much to this community for your help! You had my cameras working on my old DVR like a champ! Had to upgrade it to a DVR-16-5580 RU with 4K Cameras. With all the help in this thread and from the software itself, I was able to get them up and running again! Hopefully this will help someone else out there that’s struggling with the new commands. Love Home Assistant and love the help from the community to us new guys that are new to YAML and are not programmers! Thx again everyone!

camera 1:
  - platform: ffmpeg
    name: Front Yard West Camera
    input: rtsp://username:password@IP:85/rtsp/streaming?channel=01&subtype=0
1 Like

hi @illuzn I’ve setup the VMS bundle - thanks for the tip.
Auto-search didn’t find anything. Likely because I’m not usign a Swann NVR…?
I’m trying to connect to an existing (already on Frigate) cam, but am unable to.
I’ve used the same username, password, IP and port from my frigate config, but the VMS software is telling me the ‘Device is connecting’, then ‘Device login failed’.
I’ve tried different Port Type options from HTTP, HTTPS to Media.
Any clues?
Do I need the NVR to go down this path?

Many thanks in advance,

I too have an NVR8-7400 which I can’t get working.
I’ve tried both:
rtsp://user:password@address:554/ch03/1 format as well as the Hikvison one
rtsp://user:password@address:554/Streaming/Channels/101
but neither worked for me.

Did you end up making it work?

Yes I have it working, it’s not live streamed in Home Assistant, the image updates about every 10 seconds.
This is what I have in my configuration.yaml file

camera front:
  - platform: ffmpeg
    name: Front Garden
    input: rtsp://user:[email protected]:554/ch01/1

I suggest that you make sure that the user and password work by logging in to the Swann, and that they have the correct permissions.

Thanks for your response Dave. Still couldn’t get mine working. It appears my NVR does not support RTSP even though I’ve downloaded and installed the latest firmware GA3.1.
My network menu looks like :

No menu option for RTSP :frowning: