Catégories
Liens
Ceci est une ancienne révision du document !
EDITEUR / INTERPRETEUR IDLE (programming idel python 3)
lancer un programme depuis Python http://stackoverflow.com/questions/89228/calling-an-external-command-in-python
http://elinux.org/Omxplayer https://learn.adafruit.com/raspberry-pi-video-looper/omxplayer
To use omxplayer you'll want to make sure your video is encoded with an H.264 codec and is in a file format like .avi, .mov, .mkv, .mp4, or .m4v. If you have a video in a different format or that won't play you convert it into an H.264 video easily with some free tools. For converting a video to H.264 that omxplayer can play I recommend the Handbrake video transcoder tool. This tool is available for free for Windows, Mac, and Linux machines, and has a relatively simple interface
omxplayer /opt/vc/src/hello_pi/hello_video/test.h264
Control - C pour terminer
SCRIPT #1
la meilleur technique par toons :
import subprocess
subprocess.call(['omxplayer --alpha 100 test.mkv'], shell=True)
SCRIPT #2
import os
TheCommand ="omxplayer /opt/vc/src/hello_pi/hello_video/test.h264"
os.system(TheCommand)
SCRIPT #3 - argument
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("val", help="transparency", type=int)
args = parser.parse_args()
os.system("omxplayer --alpha args.val /opt/vc/src/hello_pi/hello_video/test.h264")