slaveCoder
slaveCoder

Reputation: 537

Interrupting the omxplayer playback in python

I am trying to change the video of omx player in python based on an event. But the problem is the next video gets loaded only after the first video finishes.

import os
os.system('omxplayer video1.mp4')
if(flag==1):
    os.system('omxplayer video2.mp4')

Is there a way to interrupt video1 in middle of playback and start second video. Note:I am working on a raspberrypi with debian wheezy and python 2.7

Upvotes: 0

Views: 1618

Answers (1)

Rudolfs Bundulis
Rudolfs Bundulis

Reputation: 11954

Omxplayer has keyboard controls so you could send the corresponding keystroke q to stop it normally before opening the next instance. Here is a similar post where a person tried to achieve similar feature, it could be helpful.

Upvotes: 1

Related Questions