Describe the bug
If Jellyfin tries to transcode certain media using ffmpeg it fails because of a faulty dependency regarding libm and glibc. This prevents any playback.
To Reproduce
I'm not sure which kind of media triggers this bug. This is the ffmpeg log of a failed transcode:
http://192.168.1.42:8096/videos/5f1a6520-1220-d964-aecd-1d340730121e/live.m3u8?DeviceId=TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvODQuMC40MTQ3LjEzNSBTYWZhcmkvNTM3LjM2fDE1OTgyMDM0NDE3MDY1&MediaSourceId=5f1a65201220d964aecd1d340730121e&VideoCodec=h264&AudioCodec=mp3,aac&VideoBitrate=139808000&AudioBitrate=192000&PlaySessionId=386e61bb77c447d28907bd4cfa5cf0fc&api_key=38aaaa3932da4be9b947649733354a03&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=da2262828ba2fca89243bce1d4dc57d5&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=51&TranscodeReasons=ContainerNotSupported
{"Protocol":"File","Id":"5f1a65201220d964aecd1d340730121e","Path":"/media/something.avi","Type":"Default","Container":"avi","Name":"something","IsRemote":false,"ETag":"da2262828ba2fca89243bce1d4dc57d5","ReadAtNativeFramerate":false,"IgnoreDts":false,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":true,"VideoType":"VideoFile","MediaStreams":[],"Formats":[],"RequiredHttpHeaders":{}}
/nix/store/nc7ic78k0zl3b9ar9kcin9pw93lfhwaw-ffmpeg-3.4.7-bin/bin/ffmpeg -f avi -i file:"/media/something.avi" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 19 -maxrate 139808000 -bufsize 279616000 -profile:v high -level 4.1 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames "expr:gte(t,n_forced*3)" -flags -global_header -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 192000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/c1c5b3e91a211859fccad37ae134c7d2/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/lib/jellyfin/transcoding-temp/c1c5b3e91a211859fccad37ae134c7d2.m3u8" -y "/var/lib/jellyfin/transcoding-temp/c1c5b3e91a211859fccad37ae134c7d2%d.ts"
/nix/store/nc7ic78k0zl3b9ar9kcin9pw93lfhwaw-ffmpeg-3.4.7-bin/bin/ffmpeg: /nix/store/wx1vk75bpdr65g6xwxbj4rw0pk04v5j3-glibc-2.27/lib/libm.so.6: version `GLIBC_2.29' not found (required by /nix/store/i3h1q2qpawskwiq4slr6fcs682qilnx6-libpng-apng-1.6.37/lib/libpng16.so.16)
Additional context
Since Jellyfin 10.6.3 is not in the nixos-unstable channel yet, I manually patched the derivation to make it build.
Notify maintainers
@nyanloutre @minijackson
Metadata
"x86_64-linux"Linux 5.4.60, NixOS, 20.03.2839.0c59c1296b2 (Markhor)yesyesnix-env (Nix) 2.3.6"nixos-unstable-20.09pre239318.c59ea8b8a0e, nixos-20.03.2839.0c59c1296b2"/nix/var/nix/profiles/per-user/root/channels/nixosDo you have the mediainfo of the file you are trying to transcode ? I've never seen this bug with standard mkv container with h264 video.
Some files where the error occurs:
But I think I also depends on the client whether it is transcoded or not. Maybe it helps with testing if you force transcoding. I'm using DLNA on a WebOS TV but it doesn't work with the web interface in Chromium as well. There was no such Issue with these files before I upgraded from 10.5.3 (I recently upgraded my NixOS from 19.09 to 20.03).
Hello, I tested a bit on my end, and can't reproduce your failure on Jellyfin 10.6.3:
Here's how I tested:
jellyfin.nix test to disable the firewall and install ffmpeg-full as a system packagenix build -L -f ./nixos/tests/jellyfin.nix driverQEMU_NET_OPTS=hostfwd=tcp::8096-:8096 ./result/bin/nixos-run-vmsmkdir /tmp/medias
cd /tmp/medias
ffmpeg -f lavfi -i testsrc=duration=10 -f lavfi -i anoisesrc=duration=10 -c:v h264 -c:a ac3 test.mkv
Then went through the jellyfin configuration wizard and tried playing on both Firefox and Chromium (both worked).
I tried creating the xvid case, but ffmpeg segfaults with libxvid (I should investigate that).
Output of
ffprobe test.mkv
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 9.3.0 (GCC)
configuration: --disable-static --prefix=/nix/store/vkk8yv64302jf8y8a9vdp4l7q7bbq59w-ffmpeg-full-4.3.1 --target_os=linux --arch=x86_64 --enable-gpl --enable-version3 --disable-nonfree --enable-shared --enable-pic --disable-small --enable-runtime-cpudetect --disable-lto --enable-gray --enable-swscale-alpha --enable-hardcoded-tables --enable-safe-bitstream-reader --enable-pthreads --disable-w32threads --disable-os2threads --enable-network --enable-pixelutils --enable-ffmpeg --enable-ffplay --enable-ffprobe --enable-avcodec --enable-avdevice --enable-avfilter --enable-avformat --enable-avresample --enable-avutil --enable-postproc --enable-swresample --enable-swscale --enable-doc --disable-htmlpages --enable-manpages --disable-podpages --disable-txtpages --enable-bzlib --enable-libcelt --enable-libdav1d --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-libfribidi --enable-libgme --enable-gnutls --enable-libgsm --enable-ladspa --enable-libmp3lame --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdc1394 --enable-iconv --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmysofa --enable-libopus --enable-librsvg --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvmaf --enable-libvpx --enable-libwebp --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-lzma --enable-nvenc --enable-openal --enable-libopencore-amrnb --disable-opengl --enable-libopenjpeg --disable-openssl --enable-libpulse --enable-librtmp --enable-sdl2 --enable-libsoxr --enable-libspeex --enable-libvidstab --enable-libvo-amrwbenc --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-zlib --disable-debug --enable-optimizations --disable-extra-warnings --disable-stripping
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, matroska,webm, from 'test.mkv':
Metadata:
ENCODER : Lavf58.45.100
Duration: 00:00:10.02, start: 0.000000, bitrate: 134 kb/s
Stream #0:0: Video: h264 (High 4:4:4 Predictive), yuv444p(progressive), 320x240 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Metadata:
ENCODER : Lavc58.91.100 libx264
DURATION : 00:00:10.005000000
Stream #0:1: Audio: ac3, 48000 Hz, mono, fltp, 96 kb/s (default)
Metadata:
ENCODER : Lavc58.91.100 ac3
DURATION : 00:00:10.016000000
Also the screenshot of jellyfin's media info for good measure.
@Noir- can you confirm this is the same format as the one that fails on your end? Could you try adding the same test.mkv to your instance and see if it works?
Also, do you have any particular transcoding options?
Here are the options that I have on a fresh Jellyfin 10.6.3 install.
What I can see is that there's a way older ffmpeg version configured in my installation because I'm on the stable channel: /nix/store/nc7ic78k0zl3b9ar9kcin9pw93lfhwaw-ffmpeg-3.4.7-bin/bin/ffmpeg
Could this be the crucial difference in our installations. I installed Jellyfin from unstable because I needed the fixes in upstream. I included it like this:
let
unstable = import <nixos-unstable> {};
in
{
disabledModules = [ "services/misc/jellyfin.nix" ];
imports =
[
./hardware-configuration.nix
<nixos-unstable/nixos/modules/services/misc/jellyfin.nix>
];
services.jellyfin = {
enable = true;
package = unstable.jellyfin;
};
}
The other transcoding options are identical. Do you know what would be the preferred way to include ffmpeg from the other channel? I'd like to try that before I continue with the other steps you suggested.
I just tried the quick and dirty way: I installed ffmpeg-full from the unstable channel and configured Jellyfin to use it. This fixed all the problems for me. I somehow assumed that the dependencies of unstable packages will be installed from the unstable channel as well. But obviously I was wrong?
From the top of my head, I think you're right actually, ffmpeg is a dependency of jellyfin and the path to the binary is passed through a wrapper, so you should have ffmpeg from unstable.
If you do systemctl cat jellyfin and then cat <path-of-jellyfin-in-the-systemd-service>, can you tell me the version of ffmpeg you see in the wrapper?
The way I installed jellyfin on my system is this:
{
nixpkgs.overlays = let
unstable = import <nixpkgs-unstable> {};
in [
(self: super: {
inherit (unstable) jellyfin;
})
];
services.jellyfin = {
enable = true;
};
}
and I do have ffmpeg-4.3.1 set in the wrapper.
I can confirm that this is the same on my system:
#! /nix/store/6737cq9nvp4k5r70qcgf61004r0l2g3v-bash-4.4-p23/bin/bash -e
export LD_LIBRARY_PATH='/nix/store/f7lws879jarjs40qznw95pwz4ngc7ib0-sqlite-3.32.3/lib:/nix/store/n9n570xdj4gnza8yp1vkgqlidadcwkbj-fontconfig-2.13.92-lib/lib:/nix/store/6nlkl2jqywpyxwk7c8il8kr5d3fkplpz-freetype-2.10.2/lib:/nix/store/v589pqjhvxrj73g3r0xb41yr84z5pwb7-gcc-9.3.0-lib/lib:/nix/store/q2wwkkllkcn8pzai29z10m4m18gklmyn-jellyfin-10.6.3/opt/jellyfin/runtimes/linux-x64/native/'${LD_LIBRARY_PATH:+':'}$LD_LIBRARY_PATH
exec "/nix/store/3d12d60dixhlx29vqqb38y29abb77ii6-aspnetcore-runtime-3.1.5/bin/dotnet" /nix/store/q2wwkkllkcn8pzai29z10m4m18gklmyn-jellyfin-10.6.3/opt/jellyfin/jellyfin.dll --ffmpeg /nix/store/1xhddl3lgy36hycz7ch2xs2jkkrw06zz-ffmpeg-4.3.1-bin/bin/ffmpeg "$@"
Weird stuff. My guess is that the application config overwrites the command line flag. I never touched this value until now. Feels a bit counter intuitive because it should be the other way around. On the other hand I also can't imagine that this behavior worked well with NixOS in the past, unless it was introduced in a recent change. I'll have a look at the source.
Ah, I was having the same problem. Clearing the ffmpeg field fixed it. However it appeared to get repopulated the next time I started jellyfin. I wonder if we will need some way to fix that field. Maybe needs a patch.
Most helpful comment
Ah, I was having the same problem. Clearing the ffmpeg field fixed it. However it appeared to get repopulated the next time I started jellyfin. I wonder if we will need some way to fix that field. Maybe needs a patch.