K
K
Kirill2015-07-08 21:45:26
linux
Kirill, 2015-07-08 21:45:26

How can I check the status of IP surveillance cameras?

Good afternoon.
Video surveillance is implemented using ip-cameras that transmit the stream to a server running ffmpeg, which converts the video and sends it to the server with nginx, on which the site is spinning, on which the video is displayed.
Question: where in this chain can I push the camera check (online / offline).
Is this check possible with ffmpeg?
Example: running ffmpeg with parameters that include the format to convert the stream to, the ip of the camera from which to receive the stream, and the ip of the server to send the stream to.
Let's say the camera was broadcasting the stream properly, but then lost the connection to the network.
How can this be tracked with ffmpeg?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
monah_tuk, 2015-07-09
@Trollevskiy

Setting the timeout (-timeout): no data ffmpeg will safely fail, returning a non-zero return code (in Unix shell, you can check with the $? value). Run it in a script, as it falls off - you can pull some REST api from the console using the same curl - raise an error in the database / for example / (although if it fell off at all, something went wrong). On the server side, you can set up a callback for the appearance of a stream (Wowza, nginx-rtmp can do this) that will register this error.
Similarly, you can try to completely dispense with callbacks on the receiving server.
Yes, I'll try to be a telepath, since the IP camera means the stream from it is most likely RTSP or MJPEG (HTTP), so look at the documentation: ffmpeg.org/ffmpeg-protocols.html#rtspand the -stimeout option. You may have to force the transport: -rtsp_transport tcp.

E
Ergil Osin, 2015-07-08
@Ernillew

Ping will only show if the camera is responding via ICMP, but it can also freeze so that it will ping, but there is no data.
I would suggest looking at the presence of a stream from the camera to the server. Data is coming, so it's alive. The IPs of the cameras are known, so you can see if something is pouring from them.

D
Dmitry, 2015-07-08
@zmeyjr

Maybe just ping

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question