I'm working on a project making a semi-randomized video player on the Raspberry Pi 4 (64-bit OS with Desktop) using Python-VLC. I have a proof of concept working, but I get some strange error messages whenever I open a new video file or skip the playback position.
Here is the error when a new file is opened:
[0000007f680013e0] mmal_xsplitter vout display error: Failed to open Xsplitter:opengles2 module
[0000007f680013e0] mmal_xsplitter vout display error: Failed to open Xsplitter:mmal_vout module
[0000007f6c013b10] avcodec decoder: Using DRM Video Accel for hardware decoding
Here is the error when I skip playback position:
[0000007f6c013b10] main decoder error: Timestamp conversion failed for 315848867: no reference clock
[0000007f6c013b10] main decoder error: Could not convert timestamp 0 for FFmpeg
The program seems to work in spite of these, but there's some minor lag I'd like to get rid of, and I want to make sure a problem doesn't arise from these errors piling up since I plan on running this program continuously for long periods of time.
Can anyone help explain what these errors mean and how I can get rid of them?
Here is the code I am using:
import vlc
import RPi.GPIO as GPIO
import time
import pygame
import random
def mute():
media_player.get_media_player().audio_set_volume(0)
opin = 2
ipin = 4
pos = [0, 0]
index = 0
GPIO.setmode(GPIO.BCM)
GPIO.setup(opin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(ipin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
player = vlc.Instance("--no-xlib")
media_player = player.media_list_player_new()
media_list = player.media_list_new()
media = player.media_new("/home/hhaudio/Desktop/Malice.mp4")
media_list.add_media(media)
media = player.media_new("/home/hhaudio/Desktop/Croc.mp4")
media_list.add_media(media)
media_player.set_media_list(media_list)
media_player.play_item_at_index(0)
mute()
print("hello!")
nextvid = 1
while True:
if GPIO.input(opin) == 0:
print("exit")
exit()
break
if GPIO.input(ipin) == 0 and nextvid == 1:
print("ipin")
media_player.get_media_player().set_position(random.random())
nextvid = GPIO.input(ipin)
time.sleep(0.001)
As a bonus, are there any recommendations y'all can give about how I could optimize things to make playback faster with VLC settings, etc?
Ran my program, according to my understanding of the VLC documentation. Works but is slightly laggy and throws errors.