0

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 play mp3 using libvlc).

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?

Community
  • 1
  • 1
hypnomaki
  • 593
  • 9
  • 22

1 Answers1

1

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)
kh25
  • 1,238
  • 1
  • 15
  • 33
  • Thx, I'll try that out sometimes.... as for now i solved the problem with by doing a Workarround. I Implemented my Own MJPEG Streamer. http://stackoverflow.com/questions/33064955/how-to-create-a-http-mjpeg-streaming-server-with-qtcp-server-sockets – hypnomaki Oct 23 '15 at 12:04
  • The above will work - I use it for a project where I sometimes have to show image files between video play lists. Pity I didn't see this sooner it may have been useful to you. – kh25 Oct 23 '15 at 12:06
  • No Problem ;) I've learnt a lot by hardcoding it. But i think im gonna switch to vlc anyway because of the advanced streaming and converting stuff.... – hypnomaki Oct 23 '15 at 12:37