2020-01-10 22:51:20 -05:00
# Jellyfin MPV Shim
2019-08-17 03:06:12 -04:00
2020-01-10 22:51:20 -05:00
Jellyfin MPV Shim is a simple and lightweight Jellyfin client, with support for Windows
and Linux. Think of it as an open source Chromecast for Jellyfin. You can cast almost
anything from Jellyfin and it will Direct Play. Subtitles are fully supported, and
there are tools to manage them like no other Jellyfin client.
2019-08-17 03:06:12 -04:00
2020-01-12 23:50:00 -05:00
This project is new, but all the major features should now be working! Please let me
know if you have any problems.
2020-01-04 14:10:26 -05:00
## Getting Started
2020-01-10 22:51:20 -05:00
If you are on Windows, simply [download the binary ](https://github.com/iwalton3/jellyfin-mpv-shim/releases ).
If you are using Linux, please see the [Linux Installation ](https://github.com/iwalton3/jellyfin-mpv-shim/blob/master/README.md#linux-installation ) section below.
2020-01-04 14:10:26 -05:00
2020-01-10 22:51:20 -05:00
To use the client, simply launch it and log into your Jellyfin server. You can then cast your media
from another Jellyfin application. Unlike Plex MPV Shim, authorization tokens for your server
are stored on your device, but you are able to cast to the player regardless of location.
2020-01-04 14:10:26 -05:00
2020-01-16 21:12:12 -05:00
The application runs with a notification icon by default. You can use this to edit the server settings,
view the application log, open the config folder, and open the application menu.
2020-01-11 13:16:45 -05:00
2020-01-13 08:20:23 -05:00
## Limitations
2020-01-16 21:12:12 -05:00
- This software is currently relatively new and may have bugs.
2020-01-13 08:20:23 -05:00
- Audio playback and Live TV are not supported.
2020-01-20 08:28:56 -05:00
- The client can’ t be shared seamlessly between multiple users on the same server. ([Link to issue. ](https://features.jellyfin.org/posts/319/mark-device-as-shared ))
2020-01-13 08:20:23 -05:00
2020-01-04 14:10:26 -05:00
## Advanced Features
2019-08-18 20:50:03 -04:00
2020-01-04 14:10:26 -05:00
### Menu
2020-01-12 23:50:00 -05:00
To open the menu, press **c** on your computer. Depending on what app you are
using to control Jellyfin, you may also be able to open the menu using that app.
The web application currently doesn't have the required buttons to do so.
2020-01-04 14:10:26 -05:00
2020-01-13 08:37:29 -05:00
The menu enables you to:
2020-01-04 14:10:26 -05:00
- Adjust video transcoding quality.
- Change the default transcoder settings.
- Change subtitles or audio, while knowing the track names.
- Change subtitles or audio for an entire series at once.
- Mark the media as unwatched and quit.
On your computer, use the arrow keys, enter, and escape to navigate. On your phone, use
the arrow buttons, ok, back, and home to navigate. (The option for remote controls is
shown next to the name of the client when you select it from the cast menu.)
2020-01-05 14:51:14 -05:00
Please also note that the on-screen controller for MPV (if available) cannot change the
audio and subtitle track configurations for transcoded media. It also cannot load external
subtitles. You must either use the menu or the application you casted from.
2020-01-04 14:10:26 -05:00
### Keyboard Shortcuts
This program supports most of the [keyboard shortcuts from MPV ](https://mpv.io/manual/stable/#interactive-control ). The custom keyboard shortcuts are:
2019-08-18 02:09:42 -04:00
2019-08-18 13:31:58 -04:00
- < > to skip episodes
- q to close player
- w to mark watched and skip
- u to mark unwatched and quit
2020-01-04 14:10:26 -05:00
- c to open the menu
Here are the notable MPV keyboard shortcuts:
- space - Pause/Play
- left/right - Seek by 5 seconds
- up/down - Seek by 1 minute
- s - Take a screenshot
- S - Take a screenshot without subtitles
- f - Toggle fullscreen
- ,/. - Seek by individual frames
- \[/\] - Change video speed by 10%
- {/} - Change video speed by 50%
- backspace - Reset speed
- m - Mute
- d - Enable/disable deinterlace
2020-01-05 14:51:14 -05:00
- Ctrl+Shift+Left/Right - Adjust subtitle delay.
2020-01-04 14:10:26 -05:00
## Configuration
The configuration file is located in different places depending on your platform. When you
launch the program, the location of the config file will be printed. The locations are:
2020-01-10 22:51:20 -05:00
- Windows - `%appdata%\jellyfin-mpv-shim\conf.json`
- Linux - `~/.config/jellyfin-mpv-shim/conf.json`
- Mac OSX - `Library/Application Support/jellyfin-mpv-shim/conf.json`
- CygWin - `~/.config/jellyfin-mpv-shim/conf.json`
2020-01-04 14:10:26 -05:00
### Transcoding
You can adjust the basic transcoder settings via the menu.
2020-01-13 08:42:39 -05:00
- `always_transcode` - This will tell the client to always transcode. Default: `false`
2020-01-04 14:10:26 -05:00
- This may be useful if you are using limited hardware that cannot handle advanced codecs.
2020-01-12 10:19:51 -05:00
- `transcode_h265` - Transcode HEVC videos. Default: `false`
- `transcode_hi10p` - Transcode 10 bit color videos. Default: `false`
2020-01-21 09:37:08 -05:00
- `remote_kbps` - Bandwidth to permit for remote streaming. Default: `10000`
2020-01-12 10:19:51 -05:00
- `local_kbps` - Bandwidth to permit for local streaming. Default: `2147483`
2020-01-04 14:10:26 -05:00
### Shell Command Triggers
2019-08-18 13:31:58 -04:00
2019-08-20 02:48:44 -04:00
You can execute shell commands on media state using the config file:
2020-01-04 14:10:26 -05:00
2020-01-02 18:21:28 -05:00
- `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.
2019-08-20 02:48:44 -04:00
2020-01-06 14:13:12 -05:00
### Subtitle Visual Settings
All of these settings apply to direct play and are adjustable through the controlling app. Note that some may not work depending on the subtitle codec. Subtitle position and color are not available for transcodes.
- `subtitle_size` - The size of the subtitles, in percent. Default: `100`
- `subtitle_color` - The color of the subtitles, in hex. Default: `#FFFFFFFF`
- `subtitle_position` - The position (top, bottom, middle). Default: `bottom`
2020-01-04 14:10:26 -05:00
### Other Configuration Options
2019-08-17 03:06:12 -04:00
2020-01-04 14:10:26 -05:00
- `player_name` - The name of the player that appears in the cast menu. Initially set from your hostname.
- `client_uuid` - The identifier for the client. Set to a random value on first run.
2020-01-13 08:42:39 -05:00
- `audio_output` - Currently has no effect. Default: `hdmi`
2020-01-14 12:52:02 -05:00
- `fullscreen` - Fullscreen the player when starting playback. Default: `true`
2020-01-16 17:56:17 -05:00
- `enable_gui` - Enable the system tray icon and GUI features. Default: `true`
2020-01-03 18:17:13 -05:00
2020-01-04 14:10:26 -05:00
### MPV Configuration
2020-01-03 18:17:13 -05:00
2020-01-04 14:10:26 -05:00
You can configure mpv directly using the `mpv.conf` file. (It is in the same folder as `conf.json` .)
This may be useful for customizing video upscaling, keyboard shortcuts, or controlling the application
via the mpv IPC server.
2020-01-03 18:17:13 -05:00
2020-01-13 08:42:39 -05:00
### Authorization
The `cred.json` file contains the authorization information. If you are having problems with the client,
such as the Now Playing not appearing or want to delete a server, you can delete this file and add the
servers again.
2020-01-04 14:10:26 -05:00
## Development
2020-01-02 18:21:28 -05:00
2020-01-04 14:10:26 -05:00
If you'd like to run the application without installing it, run `./run.py` .
The project is written entierly in Python 3. There are no closed-source
components in this project. It is fully hackable.
2020-01-02 18:21:28 -05:00
2020-01-15 10:19:55 -05:00
The project is dependent on `python-mpv` and `jellyfin-apiclient-python` . If you are
2020-01-16 22:39:46 -05:00
using Windows and would like mpv to be maximize properly, `pywin32` is also needed. The GUI
component uses `pystray` and `tkinter` , but there is a fallback cli mode.
2020-01-02 18:21:28 -05:00
2020-01-10 22:51:20 -05:00
This project is based Plex MPV Shim, which 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.
2020-01-04 14:10:26 -05:00
2020-01-10 22:55:30 -05:00
The Jellyfin API client comes from [Jellyfin for Kodi ](https://github.com/jellyfin/jellyfin-kodi/tree/master/jellyfin_kodi ).
2020-01-15 10:19:55 -05:00
The API client was originally forked for this project and is now a [separate package ](https://github.com/iwalton3/jellyfin-apiclient-python ).
2020-01-10 22:55:30 -05:00
2020-01-04 14:10:26 -05:00
## Linux Installation
If you are on Linux, you can install via pip. You'll need [libmpv1 ](https://github.com/Kagami/mpv.js/blob/master/README.md#get-libmpv ).
```bash
2020-01-10 22:51:20 -05:00
sudo pip3 install --upgrade jellyfin-mpv-shim
2020-01-04 14:10:26 -05:00
```
2020-01-19 23:44:48 -05:00
If you would like the GUI and systray features, also install `pystray` and `tkinter` :
2020-01-16 17:56:17 -05:00
```bash
sudo pip3 install pystray
sudo apt install python3-tk
```
2020-01-04 14:10:26 -05:00
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:
```bash
2020-01-05 11:30:11 -05:00
sudo pip3 install --upgrade python-mpv
2020-01-04 14:10:26 -05:00
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
```
2019-09-18 18:34:46 -04:00
2019-09-18 21:32:09 -04:00
## Building on Windows
2019-09-18 18:34:46 -04:00
2019-09-18 21:32:09 -04:00
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.)
2019-09-18 18:34:46 -04:00
1. Install [Python3 ](https://www.python.org/downloads/ ) with PATH enabled. Install [7zip ](https://ninite.com/7zip/ ).
2020-01-16 17:56:17 -05:00
2. After installing python3, open `cmd` as admin and run `pip install --upgrade pyinstaller python-mpv jellyfin-apiclient-python pywin32 pystray` .
2019-09-18 18:34:46 -04:00
3. Download [libmpv ](https://sourceforge.net/projects/mpv-player-windows/files/libmpv/ ).
2020-01-10 22:51:20 -05:00
4. Extract the `mpv-1.dll` from the file and move it to the `jellyfin-mpv-shim` folder.
5. Open a regular `cmd` prompt. Navigate to the `jellyfin-mpv-shim` folder.
2020-01-16 21:42:14 -05:00
6. Run `pyinstaller -wF --add-binary "mpv-1.dll;." --add-binary "jellyfin_mpv_shim\systray.png;." --icon media.ico run.py` .