Stop Omxplayer from Python code

Overview

Stops the video playing in Omxplayer from the Python code.

code

test.py


import subprocess
import time

#Play the video
command = 'omxplayer test.mov'
proc = subprocess.Popen(command,shell=True,stdin=subprocess.PIPE)

#--Processing from what(In this example, wait 10 seconds)  --
time.sleep(10)
#-------------------------------------

#End processing
proc.stdin.write("q")

principle

It uses that Omxplayer exits when it receives the q key input.

Recommended Posts

Stop Omxplayer from Python code
Start / stop GCE from python
Execute Python code from C # GUI
sql from python
python character code
MeCab from Python
[Python] Algorithm-aware code
[Note] Execute Python code from Excel (xlwings)
I want to make C ++ code from Python code!
Touch MySQL from Python 3
Operate Filemaker from Python
Access bitcoind from python
Changes from Python 3.0 to Python 3.5
Changes from Python 2 to Python 3.0
Python code acceleration approach
Python from or import
Rewrite Python2 code to Python3 (2to3)
infomap python draw code
Use MySQL from Python
Before writing Python code
Run python from excel
Execute command from Python
Use MySQL from Python
Operate LXC from Python
Manipulate riak from python
Force Python from Fortran
Use BigQuery from python.
Execute command from python
Python Requests status code
OpenCV basic code (python)
[Python] Read From Stdin
Use mecab-ipadic-neologd from python
[Python] Django Source Code Reading View Starting from Zero ①
Reading CSV data from DSX object storage Python code
Machine learning python code summary (updated from time to time)
Get the return code of the Python script from bat
Read QR code from image file with Python (Mac)
How to create a kubernetes pod from python code
Flatten using Python yield from
Call CPLEX from Python (DO cplex)
Get country code with python
Python with VS Code (Windows 10)
Post from Python to Slack
Cheating from PHP to Python
Import error resolution record when touching Python code from VSCode
Make MeCab available from Python3
Install ansible from source code
Information obtained from tweet_id (Python)
Run illustrator script from python
Use MySQL from Anaconda (python)
Remove one-line comments containing Japanese from source code in Python
Anaconda updated from 4.2.0 to 4.3.0 (python3.5 updated to python3.6)
Study from Python Hour4: Object-oriented ②
Query Athena from Lambda Python
Study from Python Hour3: Functions
[Python] Frequently used library code
Debug Python with VS Code
2.x, 3.x character code of python
Switch from python2.7 to python3.6 (centos7)
Connect to sqlite from python
Python frequently used code snippets