Jellyfin
Introduction
Jellyfin is the volunteer-built media solution that puts you in control of your media. Stream to any device from your own server, with no strings attached. Your media, your server, your way.
Installation
With Docker
# Pull the image
docker pull jellyfin/jellyfin
# Create the directories
mkdir {config,cache,video}
#Create the account
addgroup --system jellyfin
adduser --system --ingroup jellyfin jellyfin
# Set the permission
chown jellyfin.jellyfin config cache
# Run the container
docker run -d \
--name jellyfin \
--user $(id -u jellyfin):$(id -g jellyfin) \
--net=host \
--volume $(pwd)/config:/config \
--volume $(pwd)/cache:/cache \
--mount type=bind,source=$(pwd)/video,target=/video \
--restart=unless-stopped \
jellyfin/jellyfin
docker-compose.yaml:
services:
jellyfin:
image: jellyfin/jellyfin
container_name: jellyfin
# Optional - specify the uid and gid you would like Jellyfin to use instead of root
user: $(id -u):$(id -g)
ports:
- 8096:8096/tcp
- 7359:7359/udp
volumes:
- ./config:/config
- ./cache:/cache
- type: bind
source: ./video
target: /video
read_only: true
# Optional - extra fonts to be used during transcoding with subtitle burn-in
- type: bind
source: ./fonts
target: /usr/local/share/fonts/custom
read_only: true
restart: 'unless-stopped'
# Optional - alternative address used for autodiscovery
#environment:
# - JELLYFIN_PublishedServerUrl=http://example.com
# Optional - may be necessary for docker healthcheck to pass if running in host network mode
extra_hosts:
- 'host.docker.internal:host-gateway'
Quick Start
http://SERVER_IP:8096
Plugins
新增第三方套件庫位址
- 官方說明:https://jellyfin.org/docs/general/server/plugins/index.html
- danieladov's Repo:
https://raw.githubusercontent.com/danieladov/JellyfinPluginManifest/master/manifest.json - dkanada's Repo:
https://raw.githubusercontent.com/dkanada/jellyfin-plugin-intros/master/manifest.json
控制台 > 附加元件 > 儲存庫 > 新增
安裝附加元件
控制台 > 附加元件 > 目錄 > [選擇要安裝的元件] > Install
直播頻道
Storj DCS Cloud Storage
rclone mount
rclone mount storjdcs-jellyfin:media /root/jellyfin/video --vfs-che-mode full --dir-cache-time 1h --no-checksum --no-modtime --rc
rclone mount storjdcs-jellyfin:media /root/jellyfin/video \
--vfs-cache-mode full \
--allow-other \
--dir-cache-time 1h \
--uid=$(id -u jellyfin) \
--gid=$(id -g jellyfin) \
--no-checksum --no-modtime --rc
Refreshing the Local Sync Location
This recursively refreshes the root directory of the Rclone mount to pick up the newly uploaded files in Storj.
rclone rc vfs/refresh -v --fast-list recursive=true
- 掛載時,程式會在前景模式下執行;如果要卸載,直接 CTRL+C。
- 遠端目錄的權限 owner 只能是 root,所以必須修改 docker 的啟動參數,將這行刪除
--user $(id -u jellyfin):$(id -g jellyfin) \。
FAQ
媒體庫封面無法顯示中文。
Solution: 在主機端安裝中文字形
# On the docker host
apt install fonts-noto-cjk
# Adjust the launch command
docker run -d \
...
--volume /usr/share/fonts:/usr/share/fonts \
--volume /usr/share/fontconfig:/usr/share/fontconfig \
...
jellyfin/jellyfin
清除 Browser cache,並重新登入後再試一次。
如果還是顯示不正常,清除 config/metadata/library/ 內的所有目錄,重新掃描媒體庫後再試一次。
ASS 字幕無法顯示中文。
Solution:
- 下載中文字型檔(網頁字型)
NotoSansCJKtc-Regular.woff2,NotoSerifCJKtc-Regular.woff2。下載位址:https://github.com/CodePlayer/webfont-noto/releases - 在主機端 docker 目錄下新增 font/ 資料夾,並將字型檔上傳到該資料夾。
- 修改 docker 啟動檔,在中間處加上這一行
--volume $(pwd)/fonts:/fonts \,重新啟動 container。 - 開啟 Jellyfin 管理界面 > 控制台 > 播放 > Fallback font folder path: /fonts ,Enable fallback fonts: Checked
- Done
rclone 掛載 StorjDCS 發生錯誤:
Fatal error: failed to mount FUSE fs: fusermount: exec: "fusermount": executable file not found in $PATH
Solution:
sudo apt install fuse