main input error: open of '?rtsp://user:password@XXX.XXX.XXX.XXX/stream0' failed
Posted: 04 Jun 2018 20:17
I downloaded this project https://sourceforge.net/projects/simplestlibvlcexample example from sourceForge.
I'm currently trying to modify the "simplest_libvlc_player" project so it can display a rtsp stream of mine...
Here's the .cpp code of the project:
I would like to know what I'm doing wrong...
My rtsp link works when i open it in VlcMediaPlayer's Open Network Stream...
I'm currently trying to modify the "simplest_libvlc_player" project so it can display a rtsp stream of mine...
Here's the .cpp code of the project:
Code: Select all
#include <Windows.h>
#include "vlc/vlc.h"
int main(int argc, char* argv[])
{
libvlc_instance_t * inst;
libvlc_media_player_t *mp;
libvlc_media_t *m;
libvlc_time_t length;
int width;
int height;
int wait_time=5000;
// Load the VLC engine
inst = libvlc_new (0, NULL);
m = libvlc_media_new_location(inst, "rtsp://user:password@XXX.XXX.XXX.XXX/stream0/"); //This is the line i changed
// 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);
// Let it play
_sleep (length-wait_time);
// Stop playing
libvlc_media_player_stop (mp);
// Free the media_player
libvlc_media_player_release (mp);
libvlc_release (inst);
return 0;
}
My rtsp link works when i open it in VlcMediaPlayer's Open Network Stream...