Skip to main content

Plex MPV Shim

Plex MPV Shim is a simple and lightweight Plex client. It supports Windows and Linux and is easy to install. The project offers an experience similar to Chromecast, but with direct play and subtitle support. The application requires another app to play content and does not save login information, making it ideal for applications where security is a concern. This project is significantly smaller and less complicated than Plex Media Player, and is written entirely in open-source Python.

The project supports the following:

  • Direct play of HEVC mkv files with subtitles.
  • Switching of subtitles and audio tracks.
  • Casting videos from the iOS mobile app and web app.
  • Seeking within a video using the seek bar and buttons.
  • Play, pause, and stop.
  • Using the built-in MPV controls. (OSD and keyboard shortcuts.)
  • Configuration of mpv via mpv.conf.
  • Connecting to shared servers.
  • Installing the package system-wide.
  • Skipping between videos.
  • Autoplaying the next video. (Can be disabled.)
  • Extra keyboard shortcuts: < > skip, u unwatched/stop, w watched/next
  • Playing multiple videos in a queue.
  • The app doesn't require or save any Plex passwords or tokens.
  • Executing commands before playing, after media end, and when stopped.
  • Configurable transcoding support based on remote server and bitrate.
  • The application shows up in Plex dashboard and usage tracking.

Transcoding is supported, but needs work:

  • Transcode bandwidth decisions are currently based on values in the config file.
  • Playback of videos can fail on remote servers if the available bandwidth is lower.
  • Changing subtitle/audio tracks cannot be done after starting transcode playback.
  • The only way to control transcode video quality is using the config file.

You'll need libmpv1. To install plex-mpv-shim, run:

sudo pip3 install --upgrade plex-mpv-shim

The current Debian package for libmpv1 doesn't support the on-screen controller. If you'd like this, or need codecs that aren't packaged with Debian, you need to build mpv from source. Execute the following:

sudo apt install autoconf automake libtool libharfbuzz-dev libfreetype6-dev libfontconfig1-dev libx11-dev libxrandr-dev libvdpau-dev libva-dev mesa-common-dev libegl1-mesa-dev yasm libasound2-dev libpulse-dev libuchardet-dev zlib1g-dev libfribidi-dev git libgnutls28-dev libgl1-mesa-dev libsdl2-dev cmake wget python g++ libluajit-5.1-dev
git clone https://github.com/mpv-player/mpv-build.git
cd mpv-build
echo --enable-libmpv-shared > mpv_options
./rebuild -j4
sudo ./install
sudo ldconfig

After installing the project, you can run it with plex-mpv-shim. If you'd like to run it without installing it, run ./run.py.

Keyboard Shortcuts:

  • Standard MPV shortcuts.
  • < > to skip episodes
  • q to close player
  • w to mark watched and skip
  • u to mark unwatched and quit

You can execute shell commands on media state using the config file:

  • media_ended_cmd - When all media has played.
  • pre_media_cmd - Before the player displays. (Will wait for finish.)
  • stop_cmd - After stopping the player.
  • idle_cmd - After no activity for idle_cmd_delay seconds.

This project is based on https://github.com/wnielson/omplex, which is available under the terms of the MIT License. The project was ported to python3, modified to use mpv as the player, and updated to allow all features of the remote control api for video playback.

UPDATE: It looks like we have a reversal on the Plex Media Player situation. That being said, this project has proven to be interesting as a hackable Plex client. I plan to maintain this client, although I may not work on adding new features unless someone requests them.

Building on Windows

There is a prebuilt version for Windows in the releases section. When following these directions, please take care to ensure both the python and libmpv libraries are either 64 or 32 bit. (Don't mismatch them.)

  1. Install Python3 with PATH enabled. Install 7zip.
  2. After installing python3, open cmd as admin and run pip install pyinstaller python-mpv requests.
  3. Download libmpv.
  4. Extract the mpv-1.dll from the file and move it to the plex-mpv-shim folder.
  5. Open a regular cmd prompt. Navigate to the plex-mpv-shim folder.
  6. Run pyinstaller -cF --add-binary "mpv-1.dll;." --icon media.ico run.py.

Metadata

Release files for plex-mpv-shim 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plex-mpv-shim 1.1.2
File Size Uploaded
plex-mpv-shim-1.1.2.tar.gz 22.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plex-mpv-shim 1.1.2
File Interpreter ABI Platform
plex_mpv_shim-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 48.2 kB

Release files / plex-mpv-shim-1.1.2.tar.gz

Download URL plex-mpv-shim-1.1.2.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bd45505c957f0461ca4a5127e137fcc973abcee3fae1d8944fca51ab18636be1
BLAKE2b-256 checksum
How to use checksums
662d197ae5ad0a59e2b4d2ce3608bef763bbf9bd5d037f218ec03e0b33596a19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release files / plex_mpv_shim-1.1.2-py3-none-any.whl

Download URL plex_mpv_shim-1.1.2-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19d4ff65ba9205f6a732fce7185b58e0e89d30a223be31b6a673d4b09160c88c
BLAKE2b-256 checksum
How to use checksums
7517d7bf16a3229e7ee3aa2fbcdd5fdc7c180d97c08ea08fc85a5b8dd2890cf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

Release history Release notifications | RSS feed

1.11.0

2 release files

1.10.3

2 release files

1.10.1

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.14

2 release files

1.7.13

2 release files

1.7.12

2 release files

1.7.11

2 release files

1.7.10

2 release files

1.7.9

2 release files

1.7.8

2 release files

1.7.7

2 release files

1.7.6

2 release files

1.7.5

2 release files

1.7.4

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page