我应该使用VLC库在c编程中编写RTSP客户端,我对此有一些疑问:
谢谢。
答案 0 :(得分:0)
正如feepk在评论中所述,您无需手动执行任何RTSP设置,因为VLC使用live555库为您执行此操作。您可以使用libvlc_media_new_location函数打开RTSP连接,然后传递到您的媒体播放器实例。
例如:
// 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);