Avatar ·

Raspberry Pi + OMXPLAYER -WRAPER - starting video files in the right order by pressing buttons

📁 function, Advanced Python Topics, example, bots, AI, work

Trying to launch video files with Raspberry Pi from a python. To do this, I use Omxplayer-Wrapper.

I try to implement the following algorithm:

  1. At the beginning of the program, a.mp4 starts playing.
  2. When button 1 is pressed, a.mp4 stops and b.mp4 starts playing. When it ends, a.mp4 starts playing again.
  3. When button 2 is pressed, a.mp4 stops and c.mp4 starts playing. When it ends, a.mp4 starts playing again.

The algorithm works, but the following shortcomings are observed:

  1. After the b.mp4 file finishes before starting a.mp4, the desktop is visible (approximately 1 second).
  2. After the c.mp4 file finishes before starting a.mp4, the desktop is visible for more time (approximately 10-12 seconds).