Issues starting RTSP stream using libvlc

This forum is about all development around libVLC.
tommygr
Blank Cone
Blank Cone
Posts: 16
Joined: 08 Mar 2012 20:45

Issues starting RTSP stream using libvlc

Postby tommygr » 09 Jun 2015 20:45

Trying to get an rtsp:// stream going and it fails every time.

Here is the code I have been using. Its pretty simple so maybe I'm missing something.

Code: Select all

#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <vlc/vlc.h> int _tmain(int argc, _TCHAR* argv[]) { libvlc_instance_t * inst; libvlc_media_t *m; libvlc_media_list_t *ml; libvlc_media_list_player_t *mlp; libvlc_media_player_t *mp; libvlc_media_t *md1; /* Load the VLC engine */ #if 0 inst = libvlc_new (0, NULL); ml = libvlc_media_list_new(inst); md1 = libvlc_media_new_path(inst, "rtsp://StreamingSvr1/live/Dev_Stream.stream_3000k"); libvlc_media_list_add_media(ml, md1); libvlc_media_release(md1); mlp = libvlc_media_list_player_new(inst); mp = libvlc_media_player_new(inst); /* Use our media list */ libvlc_media_list_player_set_media_list(mlp, ml); /* Use a given media player */ libvlc_media_list_player_set_media_player(mlp, mp); /* Play */ libvlc_media_list_player_play(mlp); #endif /* Load the VLC engine */ inst = libvlc_new (0, NULL); /* Create a new item */ m = libvlc_media_new_path (inst, "rtsp://usrname:pass@StreamingSvr1/live/Dev_Stream.stream_3000k"); /* Create a media player playing environement */ mp = libvlc_media_player_new_from_media (m); /* No need to keep the media now */ libvlc_media_release (m); /* play the media_player */ libvlc_media_player_play (mp); Sleep (15000); /* Let it play a bit */ /* Stop playing */ libvlc_media_player_stop (mp); /* Free the media_player */ libvlc_media_player_release (mp); libvlc_release (inst); return 0; }
This is the response im getting in the cmd window:
libdvdnav: Using dvdnav version 5.0.3
libdvdread: Could not open d:\Projects\VlcCmdln\VlcCmdln\rtsp:\\usrname:pass@StreamingSvr1\live\Dev_Stream.stream_3000k with libdvdcss.
libdvdread: Can't open d:\Projects\VlcCmdln\VlcCmdln\rtsp:\\StreamingSvr1\live\Dev_Stream.stream_3000k for reading
libdvdnav: vm: failed to open/read the DVD
[0062d48c] filesystem access error: cannot open file d:\Projects\VlcCmdln\VlcCmdln\rtsp:\\usrname:pass@StreamingSvr1\live\Dev_Stream.stream_3000k (Invalid argument)
[0062d48c] core access error: File reading failed
[0062d48c] core access error: VLC could not open the file "d:\Projects\C++\VlcCmdln\VlcCmdln\rtsp:\\usrname:pass@StreamingSvr1\live\Dev_Stream.stream_3000k (Invalid argument).
[0062089c] core input error: open of `file:///d:/Projects/VlcCmdln/VlcCmdln/rtsp%3A%2F%2Fusrname%3Apass%40StreamingSvr1%2Flive%2FDev_Stream.stream_3000k' failed
[0062089c] core input error: Your input can't be opened
[0062089c] core input error: VLC is unable to open the MRL 'file:///d:/Projects/C%2B%2B/VlcCmdln/VlcCmdln/rtsp%3A%2F%2Fusrname%3Apass%40StreamingSvr1%2Flive%2FDev_Stream.stream_3000k'. Check the log for details.


It looks like its trying to open it up as a DVD because it using libdvdnav to open it. Same response using a Media List or just new path. Any instate on how to start the stream would be great.

-Tommy

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Issues starting RTSP stream using libvlc

Postby Rémi Denis-Courmont » 09 Jun 2015 21:27

An RTSP URL is not a file path. Please read the API documentation.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

tommygr
Blank Cone
Blank Cone
Posts: 16
Joined: 08 Mar 2012 20:45

Re: Issues starting RTSP stream using libvlc

Postby tommygr » 09 Jun 2015 23:05

Yes of course its not...

changed the call from libvlc_media_new_path() to libvlc_media_new_location() and it seems to be working.

For anyone else who needs to know this here is the doc link:
http://www.videolan.org/developers/vlc/ ... defcad3e6f


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 15 guests