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;
}
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