PHPackages                             dennmtr/phomxplayer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dennmtr/phomxplayer

ActiveLibrary

dennmtr/phomxplayer
===================

phOMXPlayer - OMXPlayer wrap shell script

06PHP

Since Aug 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/dennmtr/phomxplayer)[ Packagist](https://packagist.org/packages/dennmtr/phomxplayer)[ RSS](/packages/dennmtr-phomxplayer/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

dennmtr/phOMXPlayer
===================

[](#dennmtrphomxplayer)

[![myImage](https://camo.githubusercontent.com/515af456f1559d26c3fd98121189d931516688d7d022e2535da0a1b75882918a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f64656e6e6d74722f70686f6d78706c617965723f7374796c653d736f6369616c)](https://camo.githubusercontent.com/515af456f1559d26c3fd98121189d931516688d7d022e2535da0a1b75882918a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f64656e6e6d74722f70686f6d78706c617965723f7374796c653d736f6369616c)[![Minimum PHP Version](https://camo.githubusercontent.com/0b101e45db42c03b20e13c75689c1b43f746448a90d421ddea9b8bef18888819/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533452533445f372e332d3838393242462e737667)](https://github.com/symfony/symfony)

OMXPlayer wrap shell script, ready for REST/XML-RPC APIs or CLI implementations.

[Official OMXPlayer Documentation](https://github.com/popcornmix/omxplayer#help-and-docs)

Installation
------------

[](#installation)

### Clone

[](#clone)

```
$ git clone https://github.com/dennmtr/phomxplayer.git
```

### Using Composer

[](#using-composer)

The **recommended** way to install phOMXPlayer is through Composer

```
$ composer require dennmtr/phomxplayer:dev-main
```

#### Laravel framework

[](#laravel-framework)

Publish configuration with **artisan** command `optional`

```
$ php artisan vendor:publish --tag phOMXPlayer
```

Prepare Raspberry Pi OS
-----------------------

[](#prepare-raspberry-pi-os)

Add user to **video group** `required`

```
# usermod -a -G video
```

Add user to **audio group**

```
# usermod -a -G audio
```

Reserve at least 128MB of system memory to the GPU `required`

```
# echo "gpu_mem=128" >> /boot/config.txt
```

> **NOTICE**: *Reboot required...*

Usage
-----

[](#usage)

#### Initialize

[](#initialize)

```
$player = new OMXPlayer([
  'adev' => 'hdmi',
  'blank' => true
]);

$player->play('sample.mp4');
```

#### Request

[](#request)

```
echo 'Movie duration: ' . $player->getDuration();

//same as...

$command = new Commands\Duration();

echo 'Movie duration: ' . $command->getFormattedOutput();
```

See [Predefined command list](#predefined-commands)

#### Validate

[](#validate)

```
$input = 0.5;

if (Commands\Volume::validateInput($input)) {
  $command = new Commands\Volume($input);
  echo 'New volume level: ' . $command->getFormattedOutput();
}
```

#### Proper configure

[](#proper-configure)

```
$arguments = [
  'adev' => 'hdmi',
  'blank' => true,
  'no-keys' => true
];

$player = new OMXPlayer($arguments);

$player->adev;                  // Returns the Arguments\Adev instance via magic method if exists or null.
$player->adev->getShellArg();   // Returns '--adev hdmi' string, later passed in omxplayer execution.
$player->adev->getValue();      // Returns 'hdmi' string.
$player->adev = 'local';        // Sets a new adev argument instance with its variant value via magic method.
$player->adev->getValue();      // Returns 'local' string.

$player->map([
  'adev' => 'both',
  'with-info' => false
]);

$player->adev->getValue();      // Returns 'both' string.
$player->with_info->getValue(); // Returns false bool.
$player->blank->getValue();     // Returns true bool.

$player->map([
  'adev' => new Arguments\Adev(Arguments\Adev::HDMI),
  'blank' => new Arguments\Blank(false),
  'with-info' => true,
]);

$player->adev->getValue();      // Returns 'hdmi' string.
$player->getShellArgs(false, false);    // Returns '--adev hdmi --no-keys --with-info' string.

$input = true;

if (Arguments\Adev::isValid($input)) {
  $player->adev = $input;       // It will never reach here because boolean true is not a valid Adev value.
}

$player->adev = $input;         // It will throw an ArgumentException because boolean true is not a valid Adev value.
```

See [Argument list](#argument-List)

#### Direct call

[](#direct-call)

```
$dbus_client = new DBusClient();

$player = new OMXPlayer([], $dbus_client); // Optional

if (!empty($player->pid)) {
  $stdout = $dbus_client->call( 'org.freedesktop.DBus.Properties.Get', [
    ['string', 'org.mpris.MediaPlayer2.Player'],
    ['string', 'CanControl'],
  ]); // Assumes an active DBus session. Returns the raw stdout buffer as string
}
```

Predefined Commands
-------------------

[](#predefined-commands)

A list of predefined commands ready to use...

CommandParam TypeReturn TypeMethod AliasDescriptionActionint `enum`-actionExecutes a "keyboard" commandCanControl-boolcanControlWhether or not the player can be controlledCanGoNext-boolcanGoNextWhether or not the play can skip to the next trackCanGoPrevious-boolcanGoPreviousWhether or not the player can skip to the previous trackCanPause-boolcanPauseWhether or not the player can playCanPlay-boolcanPlayWhether or not the player can seekCanSeek-boolcanSeekReturns the total length of the playing mediaDuration-intgetDurationReturns the total length of the playing mediaGetSource-stringgetSourceThe current file or stream that is being playedHideSubtitles--hideSubtitlesTurns off subtitlesListAudio-arraylistAudioReturns and array of all known audio streamsListSubtitles-arraylistSubtitleReturns a array of all known subtitlesListVideo-arraylistVideoReturns and array of all known video streamsMute--muteMute the audio stream. If the volume is already muted, this does nothingNext--nextChapterSkip to the next chapterOpenUristringstringopenUriRestart and open another URI for playingPause--pausePause the video. If the video is playing, it will be paused, if it is paused it will stay in pause (no effect)Play--resumePlay the video. If the video is playing, it has no effect, if it is paused it will play from current positionPlaybackStatus-boolplaybackStatusThe current state of the player, either "Paused" or "Playing"Positionint `optional`intsetPosition, getPositionReturns the current position, seeks to a specific location in the file. This is an absolute seekPrevious--previousChapterSkip to the previous chapterRatefloat `optional`floatsetRate, getRateSet the playing rate and return the current rate, or gets the current rateSeekintintseekPerform a relative seekSelectAudioint-selectAudioSelects the audio stream at a given indexSelectSubtitleint-selectSubtitleSelects the subtitle at a given indexShowSubtitles--showSubtitlesTurns on subtitlesStop--stopStops the videoSupportedMimeTypes-stringgetSupportedMimeTypeSupported mime typesSupportedUriSchemes-stringgetSupportedUriSchemePlayable URI formatsToggle--toggleToggles the play state. If the video is playing, it will be paused, if it is paused it will start playingUnmute--unmuteUnmute the audio stream. If the stream is already unmuted, this does nothingVolumefloat `optional`floatsetVolumeLevel, getVolumeLevelSet the volume and return the current volume, return's the current volumeArgument List
-------------

[](#argument-list)

A list of OMXPlayer shell arguments...

ArgumentNamed KeyParam TypeAcceptable ValuesDescriptionAdev`adev`string`hdmi` `local` `both` `alsa`Audio out deviceAdvanced`advanced`int`0` `1`Enable/disable advanced deinterlace for HD videos (default enabled)Aidx`aidx`int-Audio stream indexAlign`align`string`left` `center` `right`Subtitle alignment (default: left)AllowMvc`allow-mvc`bool-Allow decoding of both views of MVC stereo streamAlpha`alpha`int`0...255`Set video transparencyAmp`amp`float`0...1`Set initial amplification in millibels (default 0)AspectMode`aspect-mode`string`letterbox` `fill` `strech`Letterbox, fill, stretch. Default: letterboxAvdict`avdict`string-Options passed to demuxer, e.g., 'rtsp\_transport:tcp,...'Blank`blank`bool-Set the video background color to blackCookie`cookie`string-Send specified cookie as part of HTTP requestsDeinterlace`deinterlace`bool-Force deinterlacingDisplay`display`int-Set display to output toFontSize`font-size`int-Font size in 1/1000 screen height (default: 55)Font`font`string-Subtitle font absolute file pathFps`fps`int`16...120`Set fps of video where timestamps are not presentHdmiClockSync`hdmiclocksync`bool-Display refresh rate to match video (default)Hw`hw`bool-Hw audio decodingItalicFont`italic-font`string-Subtitle font absolute file pathLavfdopts`lavfdopts`string-Options passed to libavformat, e.g. 'probesize:250000,...'Layer`layer`int-Set video render layer number (higher numbers are on top)Layout`layout`string`x.x`Set output speaker layout (e.g. 5.1)Lines`lines`int-Number of lines in the subtitle buffer (default: 3)Live`live`bool-Set for live tv or vod type streamLoop`loop`bool-Loop file. Ignored if file not seekableMode3D`mode3d`string`FP` `TB` `SBS`Switch tv into 3d modeNativeDeinterlace`nativedeinterlace`bool-let display handle interlaceNoBoostOnDownmix`no-boost-on-downmix`bool-Don't boost volume when downmixingNoDeinterlace`nodeinterlace`bool-Force no deinterlacingNoGhostBox`no-ghost-box`bool-No semitransparent boxes behind subtitlesNoHdmiClockSync`nohdmiclocksync`bool-Do not adjust display refresh rate to match videoNoOsd`no-osd`bool-Do not display status information on screenOrientation`orientation`int`0` `90` `180` `270`Set orientation of videoPassthrough`passthrough`bool-Audio passthroughPos`pos`int-Start positionRefresh`refresh`bool-Adjust framerate/resolution to videoSid`sid`int-Show subtitle with indexSubtitles`subtitles`string-External subtitles in UTF-8 srt formatThreshold`threshold`int-Amount of buffered data required to finish buffering \[s\]Timeout`timeout`int-Timeout for stalled file/network operations (default 10s)UserAgent`user-agent`string-Send specified User-Agent as part of HTTP requestsVol`vol`float`0...1`set initial volume in millibels (default 0)WithInfo`with-info`bool-dump stream format before playbackDevelopment
-----------

[](#development)

#### Unit Testing

[](#unit-testing)

Don't forget to define a valid absolute file path, or a valid url address for the tests process in phpunit.xml configuration file

```

```

Support
-------

[](#support)

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7598609?v=4)[Dionisis Mitropoulos](/maintainers/dennmtr)[@dennmtr](https://github.com/dennmtr)

---

Tags

dbusomxplayerraspberry-pi

### Embed Badge

![Health badge](/badges/dennmtr-phomxplayer/health.svg)

```
[![Health](https://phpackages.com/badges/dennmtr-phomxplayer/health.svg)](https://phpackages.com/packages/dennmtr-phomxplayer)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
