QuantumEntangledAndy / neolink

An RTSP bridge to Reolink IP cameras
GNU Affero General Public License v3.0
250 stars 41 forks source link

Swann NHD-815 #191

Open xboxfly15 opened 7 months ago

xboxfly15 commented 7 months ago

Describe the bug Hi, I have Swann NHD-815's and I'm trying to use this neolink fork due to the additional features but weirdly, the sub stream works but the main stream doesn't work. Now I'm able to use the upstream master (thirtythreeforty/neolink) and both the main stream and sub stream work. So I'm assuming this is due to this "Protocol more closely follows official reolink format" from the readme. I'd also like to note, the official Reolink client software works fully, I am also using a Reolink NVR.

To Reproduce Connect NHD-815 to Lan, it finds an IP using DHCP Reolink client then picks the device up, get it's IP from that. Add to neolink config with both streams. Main stream doesn't work - sub stream works.

Expected behavior The main stream to work like it does in thirtythreeforty/neolink.

Versions NVR software: VLC Media player doesn't work, Reolink client works Neolink software: Docker 76e804ea6a832f846a168ec253e9d188d466ac55 Reolink camera model and firmware: Neolink picks up Model IPC_388M, Firmware Version 541_17051800 - which matches what Reolink client says

QuantumEntangledAndy commented 2 months ago

Are you still around to debug this? I'm trying to catch up and old issues that slipped through the net. If you are I'd need some wireshark dumps that show how the connect is working on neolink and on the official camera so I can compare the difference in the wire format

xboxfly15 commented 2 months ago

Hi, should be able to get those for you this week. I've only used wireshark a little bit before, how would I get the wireshark dump for the camera, like what display filter and do I have to use the dissector?

QuantumEntangledAndy commented 2 months ago

Filter on the ip of your camera should be fine.

QuantumEntangledAndy commented 2 months ago

Don't have to use the dissector, unless you want to see the packets yourself. If you do want to use it's you'll need to do some extra setup of wireshark and not sure it's worth the effort.

QuantumEntangledAndy commented 2 months ago

Usually the best way would be to run wireshark and neolink from the same machine, and also run an offical client on that same machine. That way you don't have to do anything fancy like setting up gateways with a capture method.

xboxfly15 commented 2 months ago

Ok, I've got the .pcapng of me using the official client. Adding the camera, entering password and it starting the live view. Shell I just attach the file here or should I email it you if there is any sensitive information in it?

QuantumEntangledAndy commented 2 months ago

There's usually nothing too sensitive if you filtered it properly but maybe email it is safest if your not sure

xboxfly15 commented 1 month ago

Hi, I sent the email to the one listed on your GitHub on May 7th and haven't received any response, just checking you got my email?

QuantumEntangledAndy commented 1 month ago

I got the email thank you. I had a look at it but didn't find anything particularly different yet, I'm wondering if this is to do with how we use a single login for both streams, while the old upstream master uses a new login per stream.

Have you tried setting stream = "main" inside the [[cameras]] block. If that works then perhaps your model only supports one steam per login at a time.

xboxfly15 commented 1 month ago

When I set stream = "main" I can not connect. Setting stream = both or stream = sub I was able to connect to the NHD-815 sub stream. The streams always 20 seconds-3 minute behind the real live view(It continues to drift and get longer while connected) and always takes about 20 seconds to connect.

The sub stream seems slowed down(like its stuttering or viewing at 0.5 speed but not dropping frames according to VLC or any buffer full messages in logs). Weirdly sometimes 5 frames are just dropped when you connect.

The sub stream ALWAYS freezes after 4 minutes of being connected. While frozen it starts to drop frames and still shows frames being sent and decoded (dropped a total of 33 frames while the 5 minutes I was connected and it was frozen)

Side note, another Swann camera I got (NHD-817 PTZ):

With my Swann NHD-817 PTZ(Also running reolink firmware I believe. model IPC_3816M - Firmware Version 268_15092500 _v1.0.0.30) setting stream = "both" or stream = "main" I can connect to both streams but aside from that the behaviour is the same as the NHD-815 (takes 20-30ish seconds to connect, 20s-3m behind the real live view, the sub stream is slowed down, sub stream freezes after 4 minutes) When connecting to main stream for the first time after startup neolink::rtsp::stream] Buffer full on vidsrc 15 times in logs, sometimes it wont connect first try and then I try again and it works.

According to VLC: Both streams say they're frame rate is "29.970029". Main stream for the PTZ: video resolution: 2304x1296, buffer dimensions: 2304x1296, codec h264 - mpeg-4 avc (part 10) (h2554) Sub stream for the PTZ and NHD-815: video resolution: 640x360, buffer dimensions: 640x368, codec h264 - mpeg-4 avc (part 10) (h264)

Using docker latest https://hub.docker.com/layers/quantumentangledandy/neolink/latest/images/sha256-d75fc3df1ac0fbc167e3a3d37ccf87384478ce341f8eb41371c6aef83fd3bb47?context=explore


I now have a spare Swann NHD-815 camera that I wouldn't mind mailing to you or someone more experienced, I'd also consider a small bounty for this issue as I think there's a memory leak in the original neolink so want to stop using it, obviously not too much as I could probably replace the Swann cameras for cheaper.