C++ LibVLC Create Stream from Frames/Images

后端 未结 1 671
攒了一身酷
攒了一身酷 2021-01-26 08:01

I want to use LibVLC for creating a Video from Images. As for now I have no experience with LibVLC.

I already Implemented a test Project like here (A simple C program to

相关标签:
1条回答
  • 2021-01-26 08:23

    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_);
    

    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)
    
    0 讨论(0)
提交回复
热议问题