Does FFMPEG support RTSP authentication?

30,705

Solution 1

It has been quite q while, not sure what's the story back in 11, but yes, ffmpeg now support so.

ffmpeg -i rtsp://user:[email protected]/VideoString

works.

Solution 2

ffmpeg support rtsp authentication i think you might be missing quotes covering rstp URL.

examples:

Not working :

ffmpeg -i rtsp://user:[email protected]/VideoString

Working :

ffmpeg -i "rtsp://user:[email protected]/VideoString"

Solution 3

Yea Im having problems with this too. It seems Digest authentication is missing. there are a few mailing list comments about adding it in. see http://web.archiveorange.com/archive/v/yR2T4nBtThzJs27hqDLb but nothing conclusive.

Please be aware that HTTP basic authentication is passed in the URL string as in your example but digest is md5 encoded and passed as a separate element in the HTTP request.

also the http://www.live555.com/ library does support http/digest authentication, i have tested, it works.

to test conectivity use the 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

Solution 4

After digging a lot with ffmpeg I found that long urls with authorization fail in ffmpeg while working good with VLC. Url lenght with auth should be less than 140. So 139 chars worked while 140 failed with method SETUP failed: 401 Unauthorized

P.S. After digging in Source code I found https://github.com/FFmpeg/FFmpeg/blob/415f907ce8dcca87c9e7cfdc954b92df399d3d80/libavformat/rtsp.h#L423

Looks like it is 128 char for url without password.

Solution 5

Yes, ffmpeg does support RTSP authentication using the ffplay command.

Try using the ffplay command instead:

ffplay rtsp://user:[email protected]/VideoString

This works for me.

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

ffmpeg.org

Share:
30,705
NoviceAndNovice
Author by

NoviceAndNovice

Updated on July 09, 2022

Comments