C ++ LibVLC从帧/图像创建流
我想使用LibVLC从图像创建视频.到目前为止,我还没有使用LibVLC的经验.
I want to use LibVLC for creating a Video from Images. As for now I have no experience with LibVLC.
我已经在这里实施了一个测试项目(一个简单的使用libvlc 播放mp3的C程序).
I already Implemented a test Project like here (A simple C program to play mp3 using libvlc).
有什么方法可以创建"libvlc_media_t"实例并将其放置到图像中,而不是调用"libvlc_media_new_path"从文件中加载视频吗?还是还有其他可能性?
Is there any Way to create an Instance of "libvlc_media_t" and put images to it instead of calling "libvlc_media_new_path" to load a Video from a File? Or are there any other Possibilities?
除了创建媒体播放器之外,还创建一个媒体列表和媒体播放列表:
Create a media list and media play list in addition to a media player:
media_list_ = libvlc_media_list_new(vlc_instance_);
media_list_player_ = libvlc_media_list_player_new(vlc_instance_);
libvlc_media_list_player_set_media_list(media_list_player_, media_list_);
libvlc_media_list_player_set_media_player(media_list_player_, media_player_);
您可以按照与添加视频相同的方式将图像文件添加到vlc播放列表.
You can add image files to a vlc play list in the same way as you can add a video.
libvlc_media_t* media = libvlc_media_new_path(vlc_instance_, "image file");
if (media) {
libvlc_media_list_lock(media_list_);
libvlc_media_list_add_media(media_list_, media)
libvlc_media_list_unlock(media_list_);
}
然后您可以使用以下方法循环遍历图像:
You can then cycle through the images by using the following:
libvlc_media_list_player_play_item_at_index(media_list_player_, index)