VLC as RTSP server - authentication not working

1

1

Settings : I have an IPcam and a raspberry (RPi3 running Raspbian with VLC 3.0). The problem also happens when I replace the raspberry by a computer running Debian, also with VLC 3.0.

Goal : My goal is to be able to remotely access the stream of the IPcam through the Rpi, i.e. running vlc as a RTSP server on the Rpi. It almost works, but I still have a problem with protecting the stream exiting the Rpi by a password.

What i've done : On the Rpi, VLC is running as a RTSP server, taking as input the stream of the camera.

The command running is :

cvlc rtsp://ipcamlogin:ipcampassword@ipcamIP:554/play1.sdp --sout '#transcode{acodec=mp4a,ab=128,channels=2,samplerate=8000}:rtp{sdp=rtsp://username:password@rpiIP:8080/test.sdp}' --sout-ffmpeg-strict -2 --sout-avcodec-strict -2

(Almost) everything works, i can view my webcam remotely by connecting to the RPi.

The problem : The problem is that although i stream on rtsp://username:password@rpiIP:8080/test.sdp, the stream can be accessed at rtsp://rpiIP:8080/test.sdp without any username/password being asked. In other words, the stream can be accessed by anyone. My question is : how can I protect the output stream with a username/password ?

Thanks a lot.

toptop

Posted 2018-02-24T21:33:16.263

Reputation: 13

Answers

3

To set up username and password authentication in a RTSP stream, you need to use the --sout-rtsp-user and --sout-rtsp-pwd.

The final command should be:

cvlc rtsp://ipcamlogin:ipcampassword@ipcamIP:554/play1.sdp --sout '#transcode{acodec=mp4a,ab=128,channels=2,samplerate=8000}:rtp{sdp=rtsp://rpiIP:8080/test.sdp}' --sout-ffmpeg-strict -2 --sout-avcodec-strict -2 --sout-rtsp-user username --sout-rtsp-pwd password

The protocol://username:password@hostname:port/path is used when you connect to some remote endpoint. When you create your own stream, you need to use the --sout-... options.

user32292

Posted 2018-02-24T21:33:16.263

Reputation: 46

0

you have to set RTSP Password in to the Camera menu, some kind of home or baby cameras dos not have any function to setting pass for Real time streaming. if you can find it in menu, set the password without username, otherwise you should update firmware of you device, best regards AlirZ

Alirz

Posted 2018-02-24T21:33:16.263

Reputation: 1