2
votes

I'm trying to restream RTSP feed from a remote IP camera over RTSP. My stream output string looks like this: :sout=#rtp{sdp=rtsp://127.0.0.1:8554/stream} :no-sout-all :sout-keep :sout-rtsp-user Test :sout-rtsp-pwd Test

I've tried versions with :sout-rtsp-user=Test etc, but that password and username appear to be completely meaningless. If I want to open the stream I'm generating from another VLC window I can just connect to the stream "rtsp://127.0.0.1:8554/stream". If I connect with "rtsp://Test:[email protected]:8554/stream" it also just begins streaming. The rtsp-user and rtsp-pass commands seem to be completely meaningless. Is this user error on my part?

Thanks to anyone that can help.

1

1 Answers

1
votes

When setting up the stream, you need to pass the --sout-rtsp-user and --sout-rtsp-pwd switches when you create the MediaPlayerFactory.

I do not know of any way to make it work as media options when you invoke play.

So, for example:

String[] args = {"--sout-rtsp-user=deckard", "--sout-rtsp-pwd=nexus6"};
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(args);

This works with VLC 3.x.

When I use the VLC client to try and connect to a stream created like this, it throws up a dialog box prompting me for the username and password.

Or you can include the username and password in the MRL, e.g.

vlc rtsp://deckard:[email protected]:8554/vkampff