Skip to main content

Cast media from Plex Mobile and Web apps to MPV. (Unofficial)

Project description

Plex MPV Shim

This project allows casting of content from a Plex server to MPV, with minimal dependencies to prevent the project from becoming unmaintained. This project is 1/17th the size of Plex Media Player and is all 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.

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, so I’ll probably still continue to add features.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plex-mpv-shim-1.0.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plex_mpv_shim-1.0.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file plex-mpv-shim-1.0.0.tar.gz.

File metadata

  • Download URL: plex-mpv-shim-1.0.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for plex-mpv-shim-1.0.0.tar.gz
Algorithm Hash digest
SHA256 74ba5dc88bacfb035909ef5612a4ee930d9a14082ebe5064b854d2490c10f38a
MD5 89b37c6a746ec64ac2c31e9a124ac7c1
BLAKE2b-256 2033acb814fa55bcf2fd5a0320ca5089de2c0ff7763647e98a00a7222d047604

See more details on using hashes here.

File details

Details for the file plex_mpv_shim-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: plex_mpv_shim-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for plex_mpv_shim-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8ff04ce087a60fa35728c1e9a226928549499393643e7b51d8c53b3c2929818
MD5 3b64f17da843fccae53661cb98da9c07
BLAKE2b-256 42fd73ba2cf16676c8e2eba155ceffbb43112f2bd6850be7c2e7ee6276bd8401

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page