Skip to content

Instantly share code, notes, and snippets.

@mikeesto
Last active September 21, 2022 04:16
Show Gist options
  • Save mikeesto/511147a3e609b6bbdc9cc268c7d02807 to your computer and use it in GitHub Desktop.
Save mikeesto/511147a3e609b6bbdc9cc268c7d02807 to your computer and use it in GitHub Desktop.
OMXPlayer with Python

Use OMXPlayer with Python

Import:

import os

Play a video:

os.system( 'omxplayer --win "0 0 {0} {1}" {2}'.format( playerWidth, playerHeight, videoPath ))

Play a video with subtitles:

os.system( 'omxplayer --win "0 0 {0}  {1}" {2} --subtitles {3} --font-size {4}'.format( playerWidth, playerHeight, videoPath, subtitlesPath, subtitlesSize ))

Subtitles file must be in UTF-8 srt format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment