Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1337

Python • VLC Python library and GPIO-attached screens

$
0
0
I have a Raspberry Pi Zero with a GPIO-attached LCD. I have a Python program that incorporates the vlc library to play a video.
  • If I launch the program from a ~/.profile file, the video will play on the GPIO-attached LCD.
  • If I launch the program from a systemd service, it appears to write the actual video as blobs to the Journal. :lol: :o
  • If I launch the program from an SSH session, it will do the awful ASCII artwork.
In all cases, I would like it to play on the GPIO-attached LCD. Anyone have any ideas?

Code:

try:player = instance.media_player_new()media = instance.media_new(videoFullPath)console.info('Playing' + videoFullPath)player.set_media(media)player.audio_set_volume(volume)isPaused = Falsebacklight.fadeOn()player.play()sleep(1.5)duration = player.get_length() / 1000sleep(duration)backlight.fadeOff()except Exception as ex:console.error(str(ex))

Statistics: Posted by eat-sleep-code — Mon Feb 26, 2024 4:26 am



Viewing all articles
Browse latest Browse all 1337