Skip to content

Commit 409371c

Browse files
authored
Merge pull request #901 from junkman690/jellyfin-rffmpeg
Set FFMPEG_PATH for Jellyfin 10.8.13+ support. Update Readme
2 parents 0139084 + e1e54de commit 409371c

File tree

2 files changed

+32
-36
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-mod-jellyfin-rffmpeg-setup

2 files changed

+32
-36
lines changed

README.md

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,47 @@ In Jellyfin docker arguments, set an environment variable `DOCKER_MODS=linuxserv
1010

1111
If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:jellyfin-rffmpeg|linuxserver/mods:jellyfin-mod2`
1212

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"
13+
This mod requires you to add your preferred SSH ID to "Your jellyfin config dir"/rffmpeg/.ssh/id_rsa". This ID also needs to be able to ssh into your remote Transcode host.
1414

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
18-
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.
15+
You also need to ensure that /cache inside the container is exported on the host so it can be mapped on the remote transcode host. Eg for docker compose.
2016
```yaml
2117
volumes:
2218
- "Your jellyfin config dir":/config
2319
- "Your jellyfin config dir"/cache:/cache
2420
```
2521
See https://github.com/joshuaboniface/rffmpeg/blob/master/SETUP.md NFS setup for more details
2622
27-
EXAMPLE Docker-Compose file with WOL support via API:
23+
EXAMPLE Docker-Compose file:
2824
2925
```yaml
3026
---
31-
version: "2.1"
3227
services:
3328
jellyfin:
3429
image: lscr.io/linuxserver/jellyfin:latest
3530
container_name: jellyfin
3631
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
32+
- PUID=1000 # Docker host user for folder mapping
33+
- PGID=1000 # Docker host group for folder mapping
34+
- TZ=Europe/London # timezone
35+
- RFFMPEG_USER=jellyfin # ssh user for rffmpeg, added to rffmpeg.yml located in "Your jellyfin config dir"/rffmpeg/rffmpeg.yml on first run only
36+
- RFFMPEG_HOST=transcode # DNS or IP of rffmepg host, added to rffmpeg database on first run only
37+
- FFMPEG_PATH= # Optional, defaults to /usr/local/bin/wol_rffmpeg/ffmpeg - rffmpeg with optional WOL support. Can be set to /usr/local/bin/ffmpeg to bypass WOL wrapper and use rffmpeg directly.
38+
39+
## For WOL support use either WOL API or WOL Native
40+
41+
## WOL API settings
42+
#- RFFMPEG_HOST_MAC="12:ab:34:cd:ef:56" # Optional - Used for WOL.Transcode server mac enclosed in " " eg "aa:12:34:bb:cc:56"
43+
#- WOL_WAIT=10 # Optional - time transcode host takes to start in seconds (defaults to 30 if not set)
44+
#- RFFMPEG_WOL=api # Optional - set api to use wol_api container
45+
#- WOL_API=192.168.1.5 # Optional - WOL docker host IP
46+
#- WOL_API_PORT=8431 # Optional - port wol_api is running on
47+
48+
## WOL Native setting
49+
#- RFFMPEG_HOST_MAC="12:ab:34:cd:ef:56" # Optional - Used for WOL.Transcode server mac enclosed in " " eg "aa:12:34:bb:cc:56"
50+
#- WOL_WAIT=10 # Optional - time transcode host takes to start in seconds (defaults to 30 if not set)
51+
#- RFFMPEG_WOL=native # Optional - set to native for inbuilt WOL support within this container
52+
#- WOL_NATIVE_HOST # Optional - IP of NAT gateway with forwarded port for WoL. Only applicable when not using the WoL docker service API and when waking from outside NAT is required. Omit, or leave blank otherwise.
53+
#- WOL_NATIVE_PORT # Optional - External port on gateway for forwarding. Ensure that it is mapped to your target machine IP on port 9. Only applicable when not using the WoL docker service API and when waking from outside NAT is required. Omit, or leave blank otherwise.
4754
volumes:
4855
- /path/to/jellyfin/config:/config
4956
- /path/to/jellyfin/config/cache:/cache
@@ -56,7 +63,7 @@ services:
5663
restart: unless-stopped
5764
depends_on:
5865
- wol_api
59-
wol_api:
66+
wol_api: # Optional WOL API container
6067
image: rix1337/docker-wol_api
6168
container_name: wol_api
6269
environment:
@@ -72,21 +79,5 @@ If you want to run rffmpeg commands they must be run as ABC inside the container
7279
* To test connection ``` docker exec -it jellyfin s6-setuidgid abc /usr/local/bin/ffprobe -version ```
7380
* To view all commands ``` docker exec -it jellyfin s6-setuidgid abc /usr/local/bin/rffmpeg -h ```
7481

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-
7982
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
89-
* WOL_NATIVE_HOST = IP of NAT gateway with forwarded port for WoL *
90-
* WOL_NATIVE_PORT = External port on gateway for forwarding. Ensure that it is mapped to your target machine IP on port 9. *
91-
92-
*Optional. Only applicable when not using the WoL docker service API and when waking from outside NAT is required. Omit, or leave blank otherwise.
83+
Native WOL support is available if you are running in Jellyfin 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

root/etc/s6-overlay/s6-rc.d/init-mod-jellyfin-rffmpeg-setup/run

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,8 @@ else
4141
s6-setuidgid abc /usr/local/bin/rffmpeg add --weight 1 $RFFMPEG_HOST
4242
fi
4343
fi
44+
45+
#Set ffmpeg path if not set by user
46+
if [ -z "$FFMPEG_PATH" ]; then
47+
printf "/usr/local/bin/wol_rffmpeg/ffmpeg" > /var/run/s6/container_environment/FFMPEG_PATH
48+
fi

0 commit comments

Comments
 (0)