20

More specifically, the question is how to play rtsp streams from addresses that have a question mark in them.

I.E: rtsp://some.server.name:554/video_file.wmv?authstring=sOm3StrIN2==&param=3

I have tried various media players, but couldn't stream the file. I know for sure this is not a server problem because I could stream a test video on that server that doesn't require an authentication.
I was surprised that vlc couldn't handle such urls, so I tried mplayer but it couldn't play the streams either.
mpv was the first player in which I managed to play the test video I mentioned above, but I couldn't stream urls of the form I written above. With mpv I tried this command line:

mpv --http-header-fields='authstring:sOm3StrIN2==','param:3' \rtsp://some.server.name:554/video_file.wmv

and also tried adding the --rtsp-transport=lavf|tcp|udp|http option, but nothing worked.

Unfortunately, I know that such links (as wrote above) work with the windows media player, but I don't want to use wine or go over to windows (I have duel boot) just to watch a stream.

yaron160
  • 648

4 Answers4

25

For me the best player is ffmpeg:

ffplay rtsp://username:password@server:554/path

If authentication is not needed,

ffplay rtsp://server:554/path
Paolo Subiaco
  • 353
  • 3
  • 4
7

Have you tried to follow these instructions from the Videolan documentation (scroll down to the Video on demand section)?

It would be useful if you provide a test rtsp url that you want to stream.

Edit: the instructions from the above link are:

First launch the vlc:

vlc --ttl 12 -vvv --color -I telnet --telnet-password videolan --rtsp-host 0.0.0.0:5554

where:

  • 12 is the value of the TTL (Time To Live) of your IP packets (which means that the stream will be able to cross 11 routers).

  • telnet launches the telnet interface of the vlc.

  • videolan is the password to connect to the telnet interface.

  • 0.0.0.0 is the host address.

  • 5554 is the port on which you stream.

Then connect to the vlc telnet interface and create the vod object:

new Test vod enabled

setup Test input my_video.mpg

You can access to the stream with:

vlc rtsp://server:5554/Test

where server is the address of the streaming server (IP or DNS)

elgicse
  • 98
5

You may give a try to mplayer.

sudo apt-get install mplayer

Pass the rtsp:// URL to mplayer on its command line. There are servers out there that serve files containing a rtsp:// URL over HTTP, but then serve content in the MMS protocol. This is for compatibility with some older Microsoft players (my memory is hazy over the details), but it breaks clients that believe that RTSP is RTSP and MMS is MMS. If you obtain an rtsp:// URL that doesn't work at all, try replacing the scheme with mms://.

Anandu M Das
  • 2,303
1

Using VLC on Ubuntu 24.04

This works on all Ubuntu version since 22.04.

To play RTSP streams, you need the snap package, not the one installed by the apt. This is because the RTSP was disabled on the default Ubuntu/Debian players (VLC, mplayer, ffplay...). That's because liblivemedia constains non-free code. Read more about this on: Debian Bug report logs - #982299 RTSP streams are not displayed with version 3.0.12 on Debian Sid.

Remove the apt version

sudo apt remove vlc
sudo apt autoremove

Install the snap version

sudo snap install vlc

Play the stream

vlc rtsp://some.server.name:554/video_file.wmv?authstring=sOm3StrIN2==&param=3

Troubleshooting

If you are still getting errors (that was my case), you may need to restart your machine:

sudo reboot
sotirov
  • 4,379