1

It is possible to get image slideshow functionality with a VLC player if you just simply drag and drop selected images to it. In this case every image will get displayed for 10 seconds. How can I achive the same with python VLC bindings? I could do this manually, but isn't there a more native way to do it? For example where I just pass a list of image file names to a player?

import vlc
import time

vlc_instance = vlc.Instance()
player = vlc_instance.media_player_new()
player.set_fullscreen(True)
Media = vlc_instance.media_new( "/home/pi/image1.jpg" )
player.set_media(Media)
player.play()
time.sleep(10)
Media = vlc_instance.media_new( "/home/pi/image2.jpg" )
player.set_media(Media)
player.play()
kostr22
  • 576
  • 7
  • 27

1 Answers1

0

In short, Yes, you can!
Use the media_list_player function.

import vlc
import time
    
vlc_instance = vlc.Instance()
player = vlc_instance.media_list_player_new()
mymedia = ["ace.png","2.png","3.png","4.png","5.png"]
Media = vlc_instance.media_list_new(mymedia)
player.set_media_list(Media)
for index, name in enumerate(mymedia):
    player.play_item_at_index(index)
    time.sleep(10)
Morticia A. Addams
  • 363
  • 1
  • 7
  • 19
Rolf of Saxony
  • 21,661
  • 5
  • 39
  • 60