jeudi 21 juillet 2016

Killing omxplayer subprocess when video finish

I wrote a python script where I tried to open omxplayer in a subprocess. After that, I need to kill it when the video finishes and continue with my script.

Here is the code that I'm using for that:

omxp = Popen(["omxplayer", video_path])

And to kill it manually I am using:

pid = check_output(["pidof", "omxplayer.bin"])
os.kill(int(pid), signal.SIGINT)

How can I determine, in the main process, that the subprocess video has finished and I can safely kill it?

Aucun commentaire:

Enregistrer un commentaire