|
1 | | -# Rsync - Docker mod for openssh-server |
| 1 | +# rffmpeg - Docker mod for Jellyfin |
2 | 2 |
|
3 | | -This mod adds rsync to openssh-server, to be installed/updated during container start. |
| 3 | +This mod adds rffmpeg to Linuxserver.io's Jellyfin https://github.com/linuxserver/docker-jellyfin. |
4 | 4 |
|
5 | | -In openssh-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:openssh-server-rsync` |
| 5 | +rffmpeg is a remote FFmpeg wrapper used to execute FFmpeg commands on a remote server via SSH. It is most useful in situations involving media servers such as Jellyfin (our reference user), where one might want to perform transcoding actions with FFmpeg on a remote machine or set of machines which can better handle transcoding, take advantage of hardware acceleration, or distribute transcodes across multiple servers for load balancing. |
6 | 6 |
|
7 | | -If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:openssh-server-rsync|linuxserver/mods:openssh-server-mod2` |
| 7 | +See https://github.com/joshuaboniface/rffmpeg for more details about rffmpeg |
8 | 8 |
|
9 | | -# Mod creation instructions |
| 9 | +In Jellyfin docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:jellyfin-rffmpeg` |
10 | 10 |
|
11 | | -* Fork the repo, create a new branch based on the branch `template`. |
12 | | -* Edit the `Dockerfile` for the mod. `Dockerfile.complex` is only an example and included for reference; it should be deleted when done. |
13 | | -* Inspect the `root` folder contents. Edit, add and remove as necessary. |
14 | | -* Edit this readme with pertinent info, delete these instructions. |
15 | | -* Finally edit the `.github/workflows/BuildImage.yml`. Customize the build branch, and the vars for `BASEIMAGE` and `MODNAME`. |
16 | | -* Ask the team to create a new branch named `<baseimagename>-<modname>`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch. |
17 | | -* Submit PR against the branch created by the team. |
| 11 | +If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:jellyfin-rffmpeg|linuxserver/mods:jellyfin-mod2` |
18 | 12 |
|
| 13 | +This mod requires you to update the rffmpeg.yml located in "Your jellyfin config dir"/rffmpeg/rffmpeg.yml with your remote SSH username. You also need to add your authorized SSH file to "Your jellyfin config dir"/rffmpeg/.ssh/id_rsa" |
19 | 14 |
|
20 | | -## Tips and tricks |
| 15 | +You can specify the remote SSH username and host using ENV, note currently only supports 1 host and doesn't overwrite values other than defaults: |
| 16 | +* RFFMPEG_USER= remote SSH username |
| 17 | +* RFFMPEG_HOST= remote server name or IP |
21 | 18 |
|
22 | | -* To decrease startup times when multiple mods are used, we have consolidated `apt-get update` down to one file. As seen in the [nodejs mod](https://github.com/linuxserver/docker-mods/tree/code-server-nodejs/root/etc/cont-init.d) |
23 | | -* Some images has helpers built in, these images are currently: |
24 | | - * [Openvscode-server](https://github.com/linuxserver/docker-openvscode-server/pull/10/files) |
25 | | - * [Code-server](https://github.com/linuxserver/docker-code-server/pull/95) |
| 19 | +You also need to ensure that /cache inside the container is exported on the host so it can be mapped on the remote host. Eg for docker compose. |
| 20 | +```yaml |
| 21 | + volumes: |
| 22 | + - "Your jellyfin config dir":/config |
| 23 | + - "Your jellyfin config dir"/cache:/cache |
| 24 | +``` |
| 25 | +See https://github.com/joshuaboniface/rffmpeg/blob/master/SETUP.md NFS setup for more details |
| 26 | + |
| 27 | +EXAMPLE Docker-Compose file with WOL support via API: |
| 28 | +
|
| 29 | +```yaml |
| 30 | +--- |
| 31 | +version: "2.1" |
| 32 | +services: |
| 33 | + jellyfin: |
| 34 | + image: lscr.io/linuxserver/jellyfin:latest |
| 35 | + container_name: jellyfin |
| 36 | + environment: |
| 37 | + - PUID=1000 |
| 38 | + - PGID=1000 |
| 39 | + - TZ=Europe/London |
| 40 | + - RFFMPEG_USER=jellyfin |
| 41 | + - RFFMPEG_WOL=api |
| 42 | + - RFFMPEG_HOST=transcode |
| 43 | + - RFFMPEG_HOST_MAC="12:ab:34:cd:ef:56" |
| 44 | + - WOL_API=192.168.1.5 #docker host IP |
| 45 | + - WOL_API_PORT=8431 |
| 46 | + - WOL_WAIT=10 #time transcode host takes to start |
| 47 | + volumes: |
| 48 | + - /path/to/jellyfin/config:/config |
| 49 | + - /path/to/jellyfin/config/cache:/cache |
| 50 | + - /path/to/data:/data/ |
| 51 | + ports: |
| 52 | + - 8096:8096 |
| 53 | + - 8920:8920 #optional |
| 54 | + - 7359:7359/udp #optional |
| 55 | + - 1900:1900/udp #optional |
| 56 | + restart: unless-stopped |
| 57 | + depends_on: |
| 58 | + - wol_api |
| 59 | + wol_api: |
| 60 | + image: rix1337/docker-wol_api |
| 61 | + container_name: wol_api |
| 62 | + environment: |
| 63 | + - PORT=8431 |
| 64 | + network_mode: host |
| 65 | + restart: unless-stopped |
| 66 | +``` |
| 67 | +
|
| 68 | +If you want to run rffmpeg commands they must be run as ABC inside the container eg: |
| 69 | +* To add new host ``` docker exec -it jellyfin s6-setuidgid abc /usr/local/bin/rffmpeg add --weight 1 remotehost ``` |
| 70 | +* To view status ``` docker exec -it jellyfin s6-setuidgid abc /usr/local/bin/rffmpeg status ``` |
| 71 | +* To test connection ``` docker exec -it jellyfin s6-setuidgid abc /usr/local/bin/ffmpeg -version ``` |
| 72 | +* To test connection ``` docker exec -it jellyfin s6-setuidgid abc /usr/local/bin/ffprobe -version ``` |
| 73 | +* To view all commands ``` docker exec -it jellyfin s6-setuidgid abc /usr/local/bin/rffmpeg -h ``` |
| 74 | + |
| 75 | +You then need to set your FFMPEG binary in Jellyfin to: |
| 76 | +* /usr/local/bin/ffmpeg - Normal rffmpeg without WOL support |
| 77 | +* /usr/local/bin/wol_rffmpeg/ffmpeg - rffmpeg with WOL support |
| 78 | + |
| 79 | +WOL Support |
| 80 | +Native WOL support is available if you are running in host network mode. If not you can use the WOL_API container https://hub.docker.com/r/rix1337/docker-wol_api. Note the image name is rix1337/docker-wol_api |
| 81 | + |
| 82 | +WOL ENV: |
| 83 | +* RFFMPEG_WOL= native or api |
| 84 | +* RFFMPEG_HOST= remote host to wake |
| 85 | +* RFFMPEG_HOST_MAC= remote host to wake mac enclosed in " " eg "aa:12:34:bb:cc:56" |
| 86 | +* WOL_API = IP of docker host |
| 87 | +* WOL_API_PORT= port wol_api is running on |
| 88 | +* WOL_WAIT= time in seconds to wait for host to wake |
0 commit comments