Does FFMPEG support RTSP authentication?

Such as...

rtsp://user: pass@x.x.x.x /VideoString 
+4
source share
7 answers

It has been quite a while, but not sure if the story is back at 11, but yes, now ffmpeg supports it.

ffmpeg -i rtsp: // user: pass@x.x.x.x / VideoString

work.

+10
source

I have problems with this too. It seems that digest authentication is missing. There are a few comments on the mailing list about adding it. see http://web.archiveorange.com/archive/v/yR2T4nBtThzJs27hqDLb but nothing is convincing.

Keep in mind that basic HTTP authentication is passed in the URL string as in your example, but the digest is encoded by md5 and passed as a separate element in the HTTP request.

also the library http://www.live555.com/ supports HTTP / digest authentication, I tested it, it works.

to test health use testProgs in live555

 live/testProgs/openRTSP -4 -u admin admin -w 1280 -h 720 -f 20 rtsp://192.168.0.2/defaultPrimary?streamType=u > testmovie.mp4 
+2
source

Yes, ffmpeg supports RTSP authentication with the ffplay .

Try using the ffplay command ffplay :

 ffplay rtsp://user: pass@x.x.x.x /VideoString 

This works for me.

source ( adapted from the commands used to authenticate ftp and others using the same syntax ):

ffmpeg.org

+1
source

FFmpeg seems to support digest authentication, at least as of March 25, 2010: https://github.com/FFmpeg/FFmpeg/commit/855e7732c6bcc7d52cd0863407a721c2bf00fcf1

The logic implementing the digest calculation basically consists of this file: https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/httpauth.c

According to this changelog, it turned it into version 0.6 version:

  • HTTP Digest Authentication
0
source

I spent a whole weekend on it (ffmpeg 07/07/2014) and I can say -NO! Maybe ffmpeg has RTSP codes for digest / auth, but they don't work there. I always got 401 error from IP camera with / auth digest and good work with basic / auth.

VLC with live555 works well with any authentication.

0
source

After searching ffmpeg many times, I found that long authorization URLs do not work in ffmpeg when working with VLC. URL length with auth must be less than 140. Thus, 139 characters worked, and 140 with the method SETUP failed: 401 Unauthorized error method SETUP failed: 401 Unauthorized

PS After digging in the source code, I found https://github.com/FFmpeg/FFmpeg/blob/415f907ce8dcca87c9e7cfdc954b92df399d3d80/libavformat/rtsp.h#L423

It looks like it is 128 char for a URL without a password.

0
source

Rtsp ffmpeg authentication support I think you can skip quotes covering the rstp url.

Examples:

Does not work:

ffmpeg -i rtsp: // user: pass @ xxxx / VideoString

Working:

ffmpeg -i "rtsp: // user: pass @ xxxx / VideoString"

0
source

Source: https://habr.com/ru/post/1339968/


All Articles