C
C
caput_parietis_futui2022-03-03 23:58:23
Computer networks
caput_parietis_futui, 2022-03-03 23:58:23

How to check for RTSP stream from DVR using C#?

* optional reading * The bottom line is this, I work at the MBU engaged in video surveillance in the city. And we were given a decree about six months ago to connect all kindergartens and schools. But they all have different DVRs, different passwords everywhere, different accounts, employees of varying degrees of negligence and system engineering of varying degrees of knowledge *although I myself am not exactly a pro either. And in total, these are about 80 objects, for the connection to which we are called to monitor. They turn off, then turn on, then turn off again. *optional reading*
The question is, do you have any ideas or knowledge on how to implement a C # script that can check for the presence of an RTSP stream from DVRs. We connect them corny by forwarding opening and forwarding http and rtsp ports and going to the registrar's web face we are already looking at how it is on the school grounds. That is, it is necessary for the script to check access by ip, then access to the DVR via the port forwarded through the router in the NAT settings, somehow authorize on the registrar, and then check whether RTSP streams are coming, if not, give out that this object, can not see. If I'm dumb and didn't point out something important, please say it right here)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
AntHTML, 2022-03-04
@anthtml

What the heck is C#?
The ideal option is to use a Mikrotik with a VPN for each point that clients connect to your IP - then you don’t need to forward any ports and all settings can be cut remotely or even through an arcade
For ping, speed and other things - Zabbix standard checks, if the regions / cameras can in SMNP - there they are.
According to the RTSP test, as already above, they wrote a bash script for parsing the ffmpeg response with uploading to zabbix.
Well, on grafana, it's all more beautiful to design

A
Alexander, 2022-03-04
@Adler_lug

In C# there is a library for working with RTSP - RtspClientSharp
And there is an example of a player - RtspViewer

M
mordo445, 2022-03-04
@mordo445

There is a complication to your plan: you need to check if there is already an active stream towards your video application, and not if the camera can create a new stream. You want automation for fault detection, right? So, two cases of failure of your concept:
1. the camera, the process that forms the video stream in your direction is frozen, the watchdog overlooked it. But the camera will be able to give a new video stream, your program requests it and gets -- a false negative result.
2. The camera regularly transmits a stream to your video application, but its resources do not allow you to create a new one (the video is already received by the director of the kindergarten, security, and you). Your program requests a video stream and doesn't receive it -- a false positive.
Maybe you can find mibs for your cameras and set up zabbix properly?
You can also mirror the traffic going to your video application and check for headers or transport packets from the list of addresses. Of course, I would not contact such a person, but I would drink more in the company of friends of techies and think more))

D
damirqa007, 2022-03-13
@damirqa007

Why is S here? I think bash+ffmpeg+html5 would be more correct.
If anything, any admin can fix bash, and it's easier
BUT
Here you will have the main problem with hanging cameras, they will work, but streams will fall off.
This is solved only by rebooting a stupid piece of iron, I don’t think that schools will be able to pull this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question