[FFmpeg-user] Connecting to NVR RTSP streams

Mike ffmpeg at norgie.net
Wed Dec 20 21:04:54 EET 2023


I have been playing around trying to find a better way to access a NVR
which I own.  The official method is a web page with some shonkly
JAVAscript and a UX that was desigend by someone who, presumably, had a
sideline in BDSM.  The video is accessed over RTSP via a shonky client
written in M$ Silverlight.

I am attempting to write my own client to avoid having to keep an
ancient version of Internet Exploder running and because I enjoy
<s>pain</> a challenge.

From what I can see, the video works over something that looks like but
isn't entirely RTSP.  Here's a packet trace:

DESCRIBE rtsp:// RTSP/1.0
CSeq: 1
Accept: application/sdp, application/rtsl
Authorization: 0805459323-01-16

.RTSP/1.0 200 OK
CSeq: 1
Date: 03/25/21 10:54:18
Content-Length: 88
Content-Type: text/parameters

i=camera_name:CAM 01
m=video 0 TCP RTP/AVP 95 H.264 704_480

.SETUP rtsp:// RTSP/1.0
CSeq: 2
Transport: RTP/AVP/TCP;unicast
Authorization: 0805459323-01-16

.RTSP/1.0 200 OK
CSeq: 2
Date: 03/25/21 10:54:18
Session: 337
Transport: RTP/AVP/TCP;unicast;server_port=4522
.PLAY rtsp:// RTSP/1.0
CSeq: 3
Session: 337
Range: clock=20210325T105405-
Speed: +1.0
Bandwidth: 2048
Authorization: 0805459323-01-16

.RTSP/1.0 200 OK
CSeq: 3
Date: 03/25/21 10:54:18

.TEARDOWN rtsp:// RTSP/1.0
CSeq: 4
Session: 337
Authorization: 0805459323-01-16

.RTSP/1.0 200 OK
CSeq: 4
Date: 03/25/21 10:54:25

The first issue appears to be dealing with the Authorization header.
The "0805459323-01-16" auth string is something given to the broswer
over a seperate command and control service.  Giving rise to my first

If I have the string, can I somehow configure FFMPEG to send the auth
header?  A google suggested that -header can be used but this did not
work for me.

Question two is similar: can one configurate FFMPEG to send the RANGE
header?  Google seems to suggest not but I thought I'd ask if anyone
knew something Google didn't.

Question three: If not, can one write my own RTSP client to handle the
command and control and then point FFMPEG to the RTP port to handle
playing the video?

Question 4: If I sound completely nuts, is there a more sensible way to
be going about this?

Thanks in advance,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20231220/abf38ee9/attachment.sig>

More information about the ffmpeg-user mailing list