I have "video player" with OMXC in Python.
Something like THIS
Video file "1.mp4" is on USB stick and commands in Python:
movie1 = ("/media/pi/USBSTICK/1.mp4")
omxc = Popen(['omxplayer', '-b',movie1])
are working. But when I eject USB stick from Raspberry and put in to computer with Windows (for example when I want to change to another video 1.mp4) and put back to Raspberry, isn't working.
When I checked folders in Raspbian, folder /media/pi/USBSTICK is empty and new folder with video /media/pi/USBSTICK1 was created. Raspbian add index "1" for USBSTICK. When I try to made again, new folder was created with name USBSTICK2 and my program in Python can't find video file 1.mp4 in right folder.
I think isn't problem with Python and OMXC, but with mounting USB stick in Raspbian. I guess that problem is when USB stick is unplugged without unmounting. It happens when power supply colabs and Raspbian isn't turn off correctly.
It's possible to set up something like "unmounting empty folders" after rebooting?
import os import sys from subprocess import Popen from omxplayer import OMXPlayer movie1 = ("/media/pi/USBSTICK/1.mp4") while True: os.system('killall omxplayer.bin') omxc = Popen(['omxplayer', '-b', movie1]) omxc.wait()