jellyfin-qnap
jellyfin-qnap copied to clipboard
[Issue]: Default value for ffmpeg path is empty
Please describe your bug
There was a similar bug (https://github.com/jellyfin/jellyfin/issues/7695) some time ago with a related fix (https://github.com/pdulvp/jellyfin-qnap/pull/12)
But I see Administration > Dashboard > Server > Playback > Transcoding > FFmpeg path is empty by default
my os: CentOS Linux release 7.9.2009 (Core)
daemon has access to FFmpeg and related key added to configuration
[root@server ~]# su -s /bin/bash jellyfin bash-4.2$ whoami jellyfin bash-4.2$ ffmpeg ffmpeg version 3.4.13 Copyright (c) 2000-2023 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
grep ffmpeg /etc/sysconfig/jellyfin ... JELLYFIN_FFMPEG_OPT="—ffmpeg=/usr/bin/ffmpeg"
jellyfin 9075 0.9 1.0 4804544 162208 ? Ssl 17:55 0:13 /usr/bin/jellyfin --restartpath=/usr/libexec/jellyfin/restart.sh --ffmpeg=/usr/bin/ffmpeg
packages versions below jellyfin-10.8.13-1.el7.x86_64 jellyfin-web-10.8.13-1.el7.noarch jellyfin-server-10.8.13-1.el7.x86_64
Version: 10.8.13
Environment
- OS: CentOS Linux release 7.9.2009 (Core)
- Virtualization: no
- Clients: jellyfin-web-10.8.13-1
- Browser: Firefox
- FFmpeg Version: ffmpeg version 3.4.13 Copyright (c) 2000-2023 the FFmpeg developers, built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
- Plugins: N/A
Jellyfin logs
[2023-12-10 18:22:33.594 +02:00] [ERR] [75] MediaBrowser.Providers.Movies.MovieMetadataService: Error in "ffprobe" System.InvalidOperationException: Cannot start process because a file name has not been provided. at System.Diagnostics.Process.Start() ... [2023-12-10 18:22:35.233 +02:00] [ERR] [70] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/videos/dd3503c0-b8d2-45b0-24f1-14cb4448e165/live.m3u8". System.ArgumentException: FFmpeg path not set.
empty ffmped path in web UI configuration (I can not also modify it - there is no magnifying glass opposite it as you can see)
ok fixed issue by installing custom ffmpeg
https://github.com/jellyfin/jellyfin-ffmpeg/blob/jellyfin/INSTALL.md
and change config to this
grep ffmpeg /etc/sysconfig/jellyfin (uncoment line below) JELLYFIN_FFMPEG_OPT="—ffmpeg=/usr/local/bin/ffmpeg"
and restart service
maybe the manual must be clear for Centos that you can not use ffmpeg from the package and you need to install custom ffmpeg
Echoing the same problem, this fix worked - thanks @vova3379 .
I suspect this is due to the recent security patching to disallow custom ffmpeg via the web UI. However I had my OS package based ffmpeg (/usr/bin/ffmpeg) specified in both encoding.xml and in /etc/sysconfig/jellyfin - neither worked.
Building this custom ffmpeg, ensuring the OPT is specified in /etc/sysconfig/jellyfin and restarting does appear to work. I also had to ensure the matching path was set in encoding.xml.
I am also running CentOS Linux release 7.9.2009 (Core)
with the jellyfin-10.8.13 packages.
Hoping anyone in a situation like this comes across this when searching after their Jellyfin update breaks playback due to FFmpeg path not set
.
Full steps:
git clone https://github.com/jellyfin/jellyfin-ffmpeg.git
cd jellyfin-ffmpeg
./configure #Note you may wish to add some other flags here, the default is not great
make && make install
sed -i -e "/JELLYFIN_FFMPEG_OPT/s/^#//" /etc/sysconfig/jellyfin
sed -i -e "s/\/usr\/bin\/ffmpeg/\/usr\/local\/bin\/ffmpeg/g" /etc/sysconfig/jellyfin
sed -i -e "s/\/usr\/bin\/ffmpeg/\/usr\/local\/bin\/ffmpeg/g" /etc/jellyfin/encoding.xml
systemctl restart jellyfin
You might also want to add a -j X to your make
, as libavcodec takes a long time to compile when running single threaded.
Ok, here's some extra commands for people kagiing this issue in the future. Here's the full configure line I ran to be as close as possible to system ffmpeg, as I had all sorts of problem with a standard ./configure
(mostly around x264):
Here's what I had to do to get this configure running:
First, ffnvcodec (optional if you're not hardware accelerating):
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers
vim Makefile # Update /usr/local to /usr and lib to lib64
make -C . install # Output should show ffnvcodec.pc being copied to /usr/lib64/pkgconfig
pkg-config --modversion ffnvcodec # Confirm it's there
Install dependancies:
yum install -y gnutls-devel ladspa-devel libass-devel libbluray-devel libdrm-devel gsm-devel libmodplug-devel lame-devel openjpeg2-devel opus-devel pulseaudio-libs-devel librsvg2-devel soxr-devel speex-devel libtheora-devel libvorbis-devel libv4l-devel vid.stab-devel vo-amrwbenc-devel x264-devel x265-devel xvidcore-devel zvbi-devel openal-soft-devel libgcrypt-devel libcdio-devel libcdio-paranoia-devel
Run the configure
cd ../jellyfin-ffmpeg
./configure --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --extra-cflags=' ' --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opengl --enable-libopenjpeg --enable-libopus --disable-encoder=libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect --enable-swresample
Note I stripped out --enable-libmfx
, --enable-libopencore-amrnb
, --enable-libopencore-amrwb
from the OS original, as I had issues with functional packages I could grab from yum, and didn't need these. I also removed vpx support, as I got the error of "no supported decoders found", despite installing the baresip vp8/vp9 packages - luckily I don't actually need vp8/vp9 support.
Note also I'm using epel and rpmfusion on top of base.
Then you should be good to make -j 6 && make install
(for my 4 core machine, YMMV on -j)
As best as I can tell, jellyfin-ffmpeg
doesn't have any pre-built binary, and given how CentOS is fading and the trend is to docker now (as mentioned in their blog post earlier linked), I doubt it will be any time soon.
Another note, I had some ld errors (/usr/bin/ld: libavutil/csp.o: relocation R_X86_64_32S against
.rodata' can not be used when making a shared object; recompile with -fPIC) when making - a
make distclean` works wonders if you've already built in the directory!
In last releases, this field is empty