I play the same video on 4 screens with the python vlc module. but after the first repetition, the synchronization of the videos gradually deteriorates. the reason is the time it takes until the first video plays and then starts the second one. how can I prevent this. Or is there another way I should follow? I would be very grateful if you help me.
import json
import os
import vlc
import keyboard
import screeninfo
# VLC instance oluştur
Instance1 = vlc.Instance("--video-x=0", "--video-y=0",
'--no-audio', '--video-on-top', '--input--repeat=99999')
Instance2 = vlc.Instance("--video-x=1920", "--video-y=1",
'--no-audio', '--video-on-top', '--input--repeat=99999')
# MediaPlayer'ları oluştur
player1 = Instance1.media_player_new()
player2 = Instance2.media_player_new()
# Medya dosyalarını yükle
Media1 = Instance1.media_new("videolar/genel.mp4") # İlk medya dosyası
Media2 = Instance2.media_new("videolar/genel.mp4") # İkinci medya dosyası
# Medya dosyalarını ayarla
player1.set_media(Media1)
player2.set_media(Media2)
#player1.set_fullscreen(True)
#player2.set_fullscreen(True)
# Oynat
# Her iki oynatıcıyı da başlat
player1.set_time(0) # İlk oynatıcıyı başlangıç pozisyonuna ayarla
player2.set_time(0) # İkinci oynatıcıyı başlangıç pozisyonuna ayarla
player1.play()
player2.play()
while True:
if keyboard.is_pressed('esc'): # "ESC" tuşuna basıldığında
break # Sonsuz döngüden çık
# Oynatma bittiğinde VLC player'ı serbest bırak
for player in player_list:
player.release()