simonfish
Posts: 18
Joined: Wed Jul 01, 2020 8:24 am

Omxplayer wrapper help.

Sat Jul 11, 2020 4:43 pm

Hello everyone I’m hopping someone can help me get a video playing using omxplayer wrapper. First off I don’t understand the script from omxplayer wrapper.

I’m trying to play my video located at. Home/pi/video. And how is the volume controls once it starts ?

Code: Select all

. #!/usr/bin/env python3

from omxplayer.player import OMXPlayer
from pathlib import Path
from time import sleep

VIDEO_PATH = Path("../tests/media/test_media_1.mp4")

player = OMXPlayer(VIDEO_PATH)

sleep(5)

player.quit() [ /code]

User avatar
rpiMike
Posts: 1437
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Omxplayer wrapper help.

Wed Jul 15, 2020 2:32 pm

To play a video in /home/pi/Videos :

Code: Select all

from omxplayer.player import OMXPlayer
import time

player = OMXPlayer("/home/pi/Videos/1280.mp4")

time.sleep(5)

player.quit()
You can use player.set_volume(volume) to change the volume.

https://python-omxplayer-wrapper.readth ... yer.player

Return to “Beginners”