Trying to launch video files with Raspberry Pi from a python. To do this, I use Omxplayer-Wrapper.
nI try to implement the following algorithm:
n- n
- At the beginning of the program, the a.mp4 n
- when clicking button 1, A.MP4 stops and is tued on B.MP4. When it ends, an.mp4 n
- is tued on again when the button is pressed, the.mp4 stops and tus on C.mp4. When it ends, an.mp4 n ol> n
- after the B.MP4 file is finished before starting the A.MP4, the desktop is visible (approximately 1 second) n
- after the C.mp4 file is being lost to be lost. The launch of a.mp4 is visible the desktop for more time (approximately 10-12 seconds) n ol> n
algorithm works again, but the following shortcomings are observed:
n- n
how to carry out this task correctly?
nI give a sketch of the code:
nfromxplayer Import omxplaye from time 'path/to/a.mp4' , args = [ ''-b ', ' '-look' ]) nplayerb = Omxplayer ( 'path/to/b.mp4' , args = [ ''-b ']) nplayerc = omxplayer ( 'Path/to/C.mp4' , args = [ '-b' ]) nplayera.play () n when> true : n if button1pressedflag == true : #set in interrupt n Button1pressedflag = false n playera.pause () n plasyerb.play () n ) n Playerb.quit () n playera.play () n if button2pressedflag == true span>: #set in interrupt n button2pressedflag = false n playera.pause () n playerc.play () n blasses> when Playerc tin.
is_playing either works, then does not work.
where theis_playing () does not work, the function of playback_status (), although it is used in is_playing () ..
quit () either kills the process, then no.
stop () either stops the player, then kills the process of terrible porridge ..
solved the problem of dirty Street:
1. I am letting the video
2. I take its duration and insert it intoSleep ()
3. After the slip, I kill the video
If you need to switch the video, then switching occurs in the interruption from the button.
It seems to work ... but not beautiful somehow ...: (
question@mail.ru
·