Reputation: 11
I should write RTSP client in c programming using VLC library , I have some questions about this :
Thank you.
Upvotes: 1
Views: 3403
Reputation: 890
As stated by feepk in the comments, you do not need to manually do any of the RTSP setup, as VLC does this for you using live555 library. You can open an RTSP connection using the libvlc_media_new_location function, then pass to your media player instance.
For example:
// You must create an instance of the VLC Library
libvlc_instance_t * vlc;
// You need a player to play media
libvlc_media_player_t *mediaPlayer;
// Media object to play.
libvlc_media_t *media;
// Configure options for this instance of VLC (global settings).
// See VLC command line documentation for options.
std::vector<const char*> options;
std::vector<const char*>::iterator option;
// Load the VLC engine
vlc = libvlc_new (int(options.size()), options.data());
// Create a media item from URL
media = libvlc_media_new_location (vlc, "RTSP_URL_HERE");
mediaPlayer = libvlc_media_player_new_from_media (media);
Upvotes: 1