Closed Deathproof76 closed 2 months ago
Btw on the host everything ffmpeg related seems to be in working order. I'm also using tdarr currently running ffmpeg in docker transcoding hevc to hevc with hdr (more or less the worst kind of scenarios) etc, which are working like:
"ffmpeg -fflags +genpts -hwaccel qsv -hwaccel_output_format qsv -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v hevc_qsv<io> -map 0 -c:v hevc_qsv -b:v 1700k -minrate 1275k -maxrate 2125k -bufsize 4868k -preset slow -global_quality 22 -low_power 1 -g 120 -bf 4 -extbrc 1 -rdo 1 -mbbrc 1 -b_strategy 1 -adaptive_i 1 -adaptive_b 1 -look_ahead_depth 60 -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -f matroska -profile:v main10 -vf scale_qsv=format=p010le,hwupload=extra_hw_frames=64,format=qsv "
within the tdarr docker the ffmpeg version is this one:
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
Hyper fast Audio and Video encoder
Hi👋🏻 It could be due to a missing package which was added yesterday to the base-image.
mhhh, idk, downed, pulled latest and tried again:
immich | [Nest] 170 - 06/13/2024, 2:19:02 PM LOG [Microservices:MediaService] Started encoding video 66e2272e-7e02-49f2-9e90-2206f0b3b149 {"inputOptions":["-hwaccel qsv","-hwaccel_output_format qsv","-async_depth 4","-threads 1"],"outputOptions":["-c:v hevc_qsv","-c:a copy","-movflags faststart","-fps_mode passthrough","-map 0:0","-map 0:1","-bf 5","-refs 6","-g 256","-tag:v hvc1","-v verbose","-vf scale_qsv=-1:1080:async_depth=4:mode=hq,hwmap=derive_device=opencl,tonemap_opencl=desat=0:format=nv12:matrix=bt709:primaries=bt709:range=pc:tonemap=hable:transfer=bt709,hwmap=derive_device=qsv:reverse=1,format=qsv","-preset 3","-threads 3","-global_quality:v 35"],"twoPass":false}
immich | [Nest] 170 - 06/13/2024, 2:19:02 PM ERROR [Microservices:MediaRepository] ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
immich | built with gcc 12 (Debian 12.2.0-14)
immich | configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
immich | libavutil 58. 2.100 / 58. 2.100
immich | libavcodec 60. 3.100 / 60. 3.100
immich | libavformat 60. 3.100 / 60. 3.100
immich | libavdevice 60. 1.100 / 60. 1.100
immich | libavfilter 9. 3.100 / 9. 3.100
immich | libswscale 7. 1.100 / 7. 1.100
immich | libswresample 4. 10.100 / 4. 10.100
immich | libpostproc 57. 1.100 / 57. 1.100
immich | Selecting decoder 'hevc_qsv' because of requested hwaccel method qsv
immich | Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/photos/library/admin/2024/June-11/20240611_230413.mp4':
immich | Metadata:
immich | major_brand : mp42
immich | minor_version : 0
immich | compatible_brands: isommp42
immich | creation_time : 2024-06-11T21:04:29.000000Z
immich | location : +53.6029+010.0021/
immich | location-eng : +53.6029+010.0021/
immich | com.android.version: 14
immich | com.android.capture.fps: 60.000000
immich | Duration: 00:00:14.66, start: 0.000000, bitrate: 76020 kb/s
immich | Stream #0:0[0x1](eng): Video: hevc (Main 10), 1 reference frame (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/smpte2084, left), 3840x2160 (3840x2176), 75783 kb/s, 60.05 fps, 120 tbr, 90k tbn (default)
immich | Metadata:
immich | creation_time : 2024-06-11T21:04:29.000000Z
immich | handler_name : VideoHandle
immich | vendor_id : [0][0][0][0]
immich | Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
immich | Metadata:
immich | creation_time : 2024-06-11T21:04:29.000000Z
immich | handler_name : SoundHandle
immich | vendor_id : [0][0][0][0]
immich | [AVHWDeviceContext @ 0x464ba0c22c0] Cannot open DRM render node for device 0.
immich | [AVHWDeviceContext @ 0x464ba0c22c0] Cannot open DRM render node for device 1.
immich | [AVHWDeviceContext @ 0x464ba0c22c0] Cannot open DRM render node for device 2.
immich | [AVHWDeviceContext @ 0x464ba0c22c0] Cannot open DRM render node for device 3.
immich | [AVHWDeviceContext @ 0x464ba0c22c0] Cannot open DRM render node for device 4.
immich | [AVHWDeviceContext @ 0x464ba0c22c0] Cannot open DRM render node for device 5.
immich | [AVHWDeviceContext @ 0x464ba0c22c0] Cannot open DRM render node for device 6.
immich | [AVHWDeviceContext @ 0x464ba0c22c0] Cannot open DRM render node for device 7.
immich | [AVHWDeviceContext @ 0x464ba0c22c0] No VA display found for any default device.
immich | Device creation failed: -22.
immich | No device available for decoder: device type qsv needed for codec hevc_qsv.
immich | Stream mapping:
immich | Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> hevc (hevc_qsv))
immich | Stream #0:1 -> #0:1 (copy)
immich | Device setup failed for decoder on input stream #0:0 : Invalid argument
immich | [AVIOContext @ 0x464ba030f00] Statistics: 0 bytes written, 0 seeks, 0 writeouts
immich | [AVIOContext @ 0x464ba030180] Statistics: 442702 bytes read, 2 seeks
immich |
immich | [Nest] 170 - 06/13/2024, 2:19:02 PM ERROR [Microservices:MediaService] Error: ffmpeg exited with code 1:
immich | [Nest] 170 - 06/13/2024, 2:19:02 PM ERROR [Microservices:MediaService] Error occurred during transcoding. Retrying with QSV acceleration disabled.
root@60e5430e6967:/# ffmpeg -v debug -hide_banner -init_hw_device qsv
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'qsv'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Applying option hide_banner (do not show program banner) with argument 1.
Applying option init_hw_device (initialise hardware device) with argument qsv.
[AVHWDeviceContext @ 0x64a463ff5b00] Trying to use DRM render node for device 0, with matching kernel driver (i915).
[AVHWDeviceContext @ 0x64a463ff5b00] libva: VA-API version 1.21.0
[AVHWDeviceContext @ 0x64a463ff5b00] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x64a463ff5b00] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x64a463ff5b00] libva: Found init function __vaDriverInit_1_21
[AVHWDeviceContext @ 0x64a463ff5b00] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x64a463ff5b00] Initialised VAAPI connection: version 1.21
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x42475241 -> argb.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x52474241 -> abgr.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x42475258 -> 0rgb.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x52474258 -> 0bgr.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x30335241 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x30334241 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x30335258 -> x2rgb10le.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x30334258 -> x2bgr10le.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x36314752 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x56555941 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x56555958 -> vuyx.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x30303859 -> gray.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x3132564e -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x50313134 -> yuv411p.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x48323234 -> yuv422p.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x56323234 -> yuv440p.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x50343434 -> yuv444p.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x33434d49 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x32313050 -> p012le.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x36313050 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x30313259 -> y210le.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x32313259 -> y212le.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x36313259 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x30313459 -> xv30le.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x32313459 -> xv36le.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x36313459 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x50424752 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] Format 0x50524742 -> unknown.
[AVHWDeviceContext @ 0x64a463ff5b00] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.1 (0593864).
[AVHWDeviceContext @ 0x64a463ff5b00] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x64a463ff58c0] Use Intel(R) oneVPL to create MFX session, API version is 2.10, the required implementation version is 1.3
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
[AVHWDeviceContext @ 0x64a463ff58c0] Initialize MFX session: implementation version is 2.10
Successfully parsed a group of options.
The immich image has not been built with the new base-image. Can you try with this docker image ? ghcr.io/martabal/immich:latest
Pulled ghcr.io/martabal/immich:latest but it still does not want to work 🤨 tried a bunch of different setting:
immich | [Nest] 151 - 06/13/2024, 6:16:34 PM LOG [Microservices:MediaService] Started encoding video 66e2272e-7e02-49f2-9e90-2206f0b3b149 {"inputOptions":["-hwaccel qsv","-hwaccel_output_format qsv","-async_depth 4","-threads 1"],"outputOptions":["-c:v hevc_qsv","-c:a copy","-movflags faststart","-fps_mode passthrough","-map 0:0","-map 0:1","-bf 5","-refs 6","-g 256","-tag:v hvc1","-v verbose","-vf scale_qsv=-1:1080:async_depth=4:mode=hq,hwmap=derive_device=opencl,tonemap_opencl=desat=0:format=nv12:matrix=bt709:primaries=bt709:range=pc:tonemap=hable:transfer=bt709,hwmap=derive_device=qsv:reverse=1,format=qsv","-preset 3","-threads 3","-global_quality:v 35"],"twoPass":false}
immich | [Nest] 151 - 06/13/2024, 6:16:34 PM ERROR [Microservices:MediaRepository] ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
immich | built with gcc 13 (Ubuntu 13.2.0-23ubuntu4)
immich | configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
immich | libavutil 58. 2.100 / 58. 2.100
immich | libavcodec 60. 3.100 / 60. 3.100
immich | libavformat 60. 3.100 / 60. 3.100
immich | libavdevice 60. 1.100 / 60. 1.100
immich | libavfilter 9. 3.100 / 9. 3.100
immich | libswscale 7. 1.100 / 7. 1.100
immich | libswresample 4. 10.100 / 4. 10.100
immich | libpostproc 57. 1.100 / 57. 1.100
immich | Selecting decoder 'hevc_qsv' because of requested hwaccel method qsv
immich | Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/photos/library/admin/2024/June-11/20240611_230413.mp4':
immich | Metadata:
immich | major_brand : mp42
immich | minor_version : 0
immich | compatible_brands: isommp42
immich | creation_time : 2024-06-11T21:04:29.000000Z
immich | location : +53.6029+010.0021/
immich | location-eng : +53.6029+010.0021/
immich | com.android.version: 14
immich | com.android.capture.fps: 60.000000
immich | Duration: 00:00:14.66, start: 0.000000, bitrate: 76020 kb/s
immich | Stream #0:0[0x1](eng): Video: hevc (Main 10), 1 reference frame (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/smpte2084, left), 3840x2160 (3840x2176), 75783 kb/s, 60.05 fps, 120 tbr, 90k tbn (default)
immich | Metadata:
immich | creation_time : 2024-06-11T21:04:29.000000Z
immich | handler_name : VideoHandle
immich | vendor_id : [0][0][0][0]
immich | Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
immich | Metadata:
immich | creation_time : 2024-06-11T21:04:29.000000Z
immich | handler_name : SoundHandle
immich | vendor_id : [0][0][0][0]
immich | [AVHWDeviceContext @ 0x27f180c22c0] Cannot open DRM render node for device 0.
immich | [AVHWDeviceContext @ 0x27f180c22c0] Cannot open DRM render node for device 1.
immich | [AVHWDeviceContext @ 0x27f180c22c0] Cannot open DRM render node for device 2.
immich | [AVHWDeviceContext @ 0x27f180c22c0] Cannot open DRM render node for device 3.
immich | [AVHWDeviceContext @ 0x27f180c22c0] Cannot open DRM render node for device 4.
immich | [AVHWDeviceContext @ 0x27f180c22c0] Cannot open DRM render node for device 5.
immich | [AVHWDeviceContext @ 0x27f180c22c0] Cannot open DRM render node for device 6.
immich | [AVHWDeviceContext @ 0x27f180c22c0] Cannot open DRM render node for device 7.
immich | [AVHWDeviceContext @ 0x27f180c22c0] No VA display found for any default device.
immich | Device creation failed: -22.
immich | No device available for decoder: device type qsv needed for codec hevc_qsv.
immich | Stream mapping:
immich | Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> hevc (hevc_qsv))
immich | Stream #0:1 -> #0:1 (copy)
immich | Device setup failed for decoder on input stream #0:0 : Invalid argument
immich | [AVIOContext @ 0x27f18050f00] Statistics: 0 bytes written, 0 seeks, 0 writeouts
immich | [AVIOContext @ 0x27f18050180] Statistics: 442702 bytes read, 2 seeks
immich |
immich | [Nest] 151 - 06/13/2024, 6:16:34 PM ERROR [Microservices:MediaService] Error: ffmpeg exited with code 1:
immich | [Nest] 151 - 06/13/2024, 6:16:34 PM ERROR [Microservices:MediaService] Error occurred during transcoding. Retrying with QSV acceleration disabled.
immich | [Nest] 172 - 06/13/2024, 6:16:56 PM LOG [Api:EventRepository] Websocket Disconnect: L48uJhiQTZTAO6_-AAAD
immich | [Nest] 172 - 06/13/2024, 6:17:00 PM LOG [Api:EventRepository] Websocket Connect: 2ezZ4WM-4wlo9vrnAAAF
immich | [Nest] 172 - 06/13/2024, 6:17:33 PM LOG [Api:SystemConfigService~pqhyhj1e] LogLevel=log (set via system config)
immich | [Nest] 172 - 06/13/2024, 6:17:33 PM LOG [Api:SystemConfigService~pqhyhj1e] LogLevel=log (set via system config)
immich | [Nest] 151 - 06/13/2024, 6:17:33 PM LOG [Microservices:SystemConfigService] LogLevel=log (set via system config)
immich | [Nest] 151 - 06/13/2024, 6:17:33 PM LOG [Microservices:MapRepository] Initializing metadata repository
immich | [Nest] 151 - 06/13/2024, 6:17:33 PM LOG [Microservices:MetadataService] Initialized local reverse geocoder
postgres16 | 2024-06-13 18:17:50.109 CEST [27] LOG: checkpoint complete: wrote 10528 buffers (64.3%); 0 WAL file(s) added, 0 removed, 33 recycled; write=269.642 s, sync=0.020 s, total=269.748 s; sync files=26, longest=0.002 s, average=0.001 s; distance=541098 kB, estimate=541098 kB; lsn=3/8007A9B0, redo lsn=3/74400060
immich | [Nest] 172 - 06/13/2024, 6:17:54 PM LOG [Api:SystemConfigService~j9ii9vgj] LogLevel=log (set via system config)
immich | [Nest] 172 - 06/13/2024, 6:17:54 PM LOG [Api:SystemConfigService~j9ii9vgj] LogLevel=log (set via system config)
immich | [Nest] 151 - 06/13/2024, 6:17:54 PM LOG [Microservices:SystemConfigService] LogLevel=log (set via system config)
immich | [Nest] 151 - 06/13/2024, 6:17:54 PM LOG [Microservices:MapRepository] Initializing metadata repository
immich | [Nest] 151 - 06/13/2024, 6:17:54 PM LOG [Microservices:MetadataService] Initialized local reverse geocoder
postgres16 | 2024-06-13 18:18:20.136 CEST [27] LOG: checkpoint starting: time
immich | [Nest] 151 - 06/13/2024, 6:18:20 PM LOG [Microservices:MediaService] Successfully encoded 66e2272e-7e02-49f2-9e90-2206f0b3b149
immich | [Nest] 151 - 06/13/2024, 6:18:24 PM LOG [Microservices:MediaService] Started encoding video 43c71894-501a-4b75-9292-2a2f47a2904e {"inputOptions":["-hwaccel qsv","-hwaccel_output_format qsv","-async_depth 4","-threads 1","-qsv_device /dev/dri/renderD128"],"outputOptions":["-c:v hevc_qsv","-c:a copy","-movflags faststart","-fps_mode passthrough","-map 0:0","-map 0:1","-bf 0","-refs 5","-g 256","-tag:v hvc1","-v verbose","-vf scale_qsv=-1:1080:async_depth=4:mode=hq,hwmap=derive_device=opencl,tonemap_opencl=desat=0:format=nv12:matrix=bt709:primaries=bt709:range=pc:tonemap=hable:transfer=bt709,hwmap=derive_device=qsv:reverse=1,format=qsv","-preset 3","-threads 3","-global_quality:v 35"],"twoPass":false}
immich | [Nest] 151 - 06/13/2024, 6:18:24 PM ERROR [Microservices:MediaRepository] ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
immich | built with gcc 13 (Ubuntu 13.2.0-23ubuntu4)
immich | configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
immich | libavutil 58. 2.100 / 58. 2.100
immich | libavcodec 60. 3.100 / 60. 3.100
immich | libavformat 60. 3.100 / 60. 3.100
immich | libavdevice 60. 1.100 / 60. 1.100
immich | libavfilter 9. 3.100 / 9. 3.100
immich | libswscale 7. 1.100 / 7. 1.100
immich | libswresample 4. 10.100 / 4. 10.100
immich | libpostproc 57. 1.100 / 57. 1.100
immich | [AVHWDeviceContext @ 0x42bb00c0240] Failed to open /dev/dri/renderD128 as DRM device node.
immich | [AVHWDeviceContext @ 0x42bb00c0240] No VA display found for device /dev/dri/renderD128.
immich | Device creation failed: -22.
immich | Failed to set value '/dev/dri/renderD128' for option 'qsv_device': Invalid argument
immich | Error parsing global options: Invalid argument
immich |
immich | [Nest] 151 - 06/13/2024, 6:18:24 PM ERROR [Microservices:MediaService] Error: ffmpeg exited with code 1: Device creation failed: -22.
immich | Failed to set value '/dev/dri/renderD128' for option 'qsv_device': Invalid argument
immich | Error parsing global options: Invalid argument
immich |
immich | [Nest] 151 - 06/13/2024, 6:18:24 PM ERROR [Microservices:MediaService] Error occurred during transcoding. Retrying with QSV acceleration disabled.
postgres16 | 2024-06-13 18:18:38.642 CEST [27] LOG: checkpoint complete: wrote 36 buffers (0.2%); 0 WAL file(s) added, 0 removed, 12 recycled; write=18.454 s, sync=0.017 s, total=18.506 s; sync files=22, longest=0.001 s, average=0.001 s; distance=193004 kB, estimate=506288 kB; lsn=3/8007CFC0, redo lsn=3/8007B290
immich | [Nest] 151 - 06/13/2024, 6:19:10 PM LOG [Microservices:MediaService] Successfully encoded 43c71894-501a-4b75-9292-2a2f47a2904e
immich | [Nest] 172 - 06/13/2024, 6:19:54 PM LOG [Api:SystemConfigService~lh5sgk48] LogLevel=log (set via system config)
immich | [Nest] 172 - 06/13/2024, 6:19:54 PM LOG [Api:SystemConfigService~lh5sgk48] LogLevel=log (set via system config)
immich | [Nest] 151 - 06/13/2024, 6:19:54 PM LOG [Microservices:SystemConfigService] LogLevel=log (set via system config)
immich | [Nest] 151 - 06/13/2024, 6:19:54 PM LOG [Microservices:MapRepository] Initializing metadata repository
immich | [Nest] 151 - 06/13/2024, 6:19:54 PM LOG [Microservices:MetadataService] Initialized local reverse geocoder
immich | [Nest] 151 - 06/13/2024, 6:20:03 PM LOG [Microservices:MediaService] Started encoding video 61f67555-5d48-4009-a404-72531fee788d {"inputOptions":["-hwaccel qsv","-hwaccel_output_format qsv","-async_depth 4","-threads 1"],"outputOptions":["-c:v hevc_qsv","-c:a copy","-movflags faststart","-fps_mode passthrough","-map 0:0","-map 0:1","-bf 0","-refs 5","-g 256","-tag:v hvc1","-v verbose","-vf scale_qsv=1080:-1:async_depth=4:mode=hq,hwmap=derive_device=opencl,tonemap_opencl=desat=0:format=nv12:matrix=bt709:primaries=bt709:range=pc:tonemap=hable:transfer=bt709,hwmap=derive_device=qsv:reverse=1,format=qsv","-preset 3","-threads 3","-global_quality:v 35"],"twoPass":false}
immich | [Nest] 151 - 06/13/2024, 6:20:03 PM ERROR [Microservices:MediaRepository] ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
immich | built with gcc 13 (Ubuntu 13.2.0-23ubuntu4)
immich | configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
immich | libavutil 58. 2.100 / 58. 2.100
immich | libavcodec 60. 3.100 / 60. 3.100
immich | libavformat 60. 3.100 / 60. 3.100
immich | libavdevice 60. 1.100 / 60. 1.100
immich | libavfilter 9. 3.100 / 9. 3.100
immich | libswscale 7. 1.100 / 7. 1.100
immich | libswresample 4. 10.100 / 4. 10.100
immich | libpostproc 57. 1.100 / 57. 1.100
immich | Selecting decoder 'hevc_qsv' because of requested hwaccel method qsv
immich | Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/photos/library/admin/2024/April-07/20240407_132020.mp4':
immich | Metadata:
immich | major_brand : mp42
immich | minor_version : 0
immich | compatible_brands: isommp42
immich | creation_time : 2024-04-07T18:20:30.000000Z
immich | location : -13.1633-072.5445/
immich | location-eng : -13.1633-072.5445/
immich | com.android.version: 14
immich | com.android.capture.fps: 60.000000
immich | Duration: 00:00:09.19, start: 0.000000, bitrate: 74993 kb/s
immich | Stream #0:0[0x1](eng): Video: hevc (Main 10), 1 reference frame (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/smpte2084, left), 3840x2160 (3840x2176), 74938 kb/s, 59.99 fps, 60 tbr, 90k tbn (default)
immich | Metadata:
immich | creation_time : 2024-04-07T18:20:30.000000Z
immich | handler_name : VideoHandle
immich | vendor_id : [0][0][0][0]
immich | Side data:
immich | displaymatrix: rotation of -90.00 degrees
immich | Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
immich | Metadata:
immich | creation_time : 2024-04-07T18:20:30.000000Z
immich | handler_name : SoundHandle
immich | vendor_id : [0][0][0][0]
immich | [AVHWDeviceContext @ 0x51b360c2380] Cannot open DRM render node for device 0.
immich | [AVHWDeviceContext @ 0x51b360c2380] Cannot open DRM render node for device 1.
immich | [AVHWDeviceContext @ 0x51b360c2380] Cannot open DRM render node for device 2.
immich | [AVHWDeviceContext @ 0x51b360c2380] Cannot open DRM render node for device 3.
immich | [AVHWDeviceContext @ 0x51b360c2380] Cannot open DRM render node for device 4.
immich | [AVHWDeviceContext @ 0x51b360c2380] Cannot open DRM render node for device 5.
immich | [AVHWDeviceContext @ 0x51b360c2380] Cannot open DRM render node for device 6.
immich | [AVHWDeviceContext @ 0x51b360c2380] Cannot open DRM render node for device 7.
immich | [AVHWDeviceContext @ 0x51b360c2380] No VA display found for any default device.
immich | Device creation failed: -22.
immich | No device available for decoder: device type qsv needed for codec hevc_qsv.
immich | Stream mapping:
immich | Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> hevc (hevc_qsv))
immich | Stream #0:1 -> #0:1 (copy)
immich | Device setup failed for decoder on input stream #0:0 : Invalid argument
immich | [AVIOContext @ 0x51b36390280] Statistics: 0 bytes written, 0 seeks, 0 writeouts
immich | [AVIOContext @ 0x51b36050180] Statistics: 628703 bytes read, 2 seeks
immich |
immich | [Nest] 151 - 06/13/2024, 6:20:03 PM ERROR [Microservices:MediaService] Error: ffmpeg exited with code 1:
immich | [Nest] 151 - 06/13/2024, 6:20:03 PM ERROR [Microservices:MediaService] Error occurred during transcoding. Retrying with QSV acceleration disabled.
immich | [Nest] 151 - 06/13/2024, 6:20:37 PM LOG [Microservices:MediaService] Successfully encoded 61f67555-5d48-4009-a404-72531fee788d
immich | [Nest] 172 - 06/13/2024, 6:20:59 PM LOG [Api:SystemConfigService~9k2dn21w] LogLevel=log (set via system config)
immich | [Nest] 172 - 06/13/2024, 6:20:59 PM LOG [Api:SystemConfigService~9k2dn21w] LogLevel=log (set via system config)
immich | [Nest] 151 - 06/13/2024, 6:20:59 PM LOG [Microservices:SystemConfigService] LogLevel=log (set via system config)
immich | [Nest] 151 - 06/13/2024, 6:20:59 PM LOG [Microservices:MapRepository] Initializing metadata repository
immich | [Nest] 151 - 06/13/2024, 6:20:59 PM LOG [Microservices:MetadataService] Initialized local reverse geocoder
immich | [Nest] 151 - 06/13/2024, 6:21:09 PM LOG [Microservices:MediaService] Started encoding video 859b58fa-f9de-4be8-b21c-68a6ab5b6682 {"inputOptions":["-init_hw_device qsv=hw","-filter_hw_device hw"],"outputOptions":["-c:v hevc_qsv","-c:a copy","-movflags faststart","-fps_mode passthrough","-map 0:0","-map 0:1","-bf 0","-refs 5","-g 256","-tag:v hvc1","-v verbose","-vf zscale=t=linear:npl=100,tonemap=hable:desat=0,zscale=p=bt709:t=bt709:m=bt709:range=pc,format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:1080","-preset 3","-threads 3","-global_quality:v 35"],"twoPass":false}
immich | [Nest] 151 - 06/13/2024, 6:21:09 PM ERROR [Microservices:MediaRepository] ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
immich | built with gcc 13 (Ubuntu 13.2.0-23ubuntu4)
immich | configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
immich | libavutil 58. 2.100 / 58. 2.100
immich | libavcodec 60. 3.100 / 60. 3.100
immich | libavformat 60. 3.100 / 60. 3.100
immich | libavdevice 60. 1.100 / 60. 1.100
immich | libavfilter 9. 3.100 / 9. 3.100
immich | libswscale 7. 1.100 / 7. 1.100
immich | libswresample 4. 10.100 / 4. 10.100
immich | libpostproc 57. 1.100 / 57. 1.100
immich | [AVHWDeviceContext @ 0x4beb60c0240] Cannot open DRM render node for device 0.
immich | [AVHWDeviceContext @ 0x4beb60c0240] Cannot open DRM render node for device 1.
immich | [AVHWDeviceContext @ 0x4beb60c0240] Cannot open DRM render node for device 2.
immich | [AVHWDeviceContext @ 0x4beb60c0240] Cannot open DRM render node for device 3.
immich | [AVHWDeviceContext @ 0x4beb60c0240] Cannot open DRM render node for device 4.
immich | [AVHWDeviceContext @ 0x4beb60c0240] Cannot open DRM render node for device 5.
immich | [AVHWDeviceContext @ 0x4beb60c0240] Cannot open DRM render node for device 6.
immich | [AVHWDeviceContext @ 0x4beb60c0240] Cannot open DRM render node for device 7.
immich | [AVHWDeviceContext @ 0x4beb60c0240] No VA display found for any default device.
immich | Device creation failed: -22.
immich | Failed to set value 'qsv=hw' for option 'init_hw_device': Invalid argument
immich | Error parsing global options: Invalid argument
immich |
immich | [Nest] 151 - 06/13/2024, 6:21:09 PM ERROR [Microservices:MediaService] Error: ffmpeg exited with code 1: Device creation failed: -22.
immich | Failed to set value 'qsv=hw' for option 'init_hw_device': Invalid argument
immich | Error parsing global options: Invalid argument
immich |
immich | [Nest] 151 - 06/13/2024, 6:21:09 PM ERROR [Microservices:MediaService] Error occurred during transcoding. Retrying with QSV acceleration disabled.
Tldr: Can transcode with ffmpeg from within immich container as root user or abc user. Also replicated the ffmpeg cmd line that failed when done via immich webui. The replicated ffmpeg cmd line works as abc user from within container. Maybe immich parses ffmpeg cmd line wrong? 😅
Full output: Okay, pulled the new v1.106.4-ig289 and tried a new approach: I put an h264.mkv in the root of the photo folder (just some cut out snippet). And then opened a terminal as root user to the immich container. transcoded from h264 to hevc and hevc to hevc using my custom settings.
root@b3010456a8fd:/photos# ffmpeg -fflags +genpts -hwaccel qsv -hwaccel_output_format qsv -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv -i "input.mkv" -map 0 -c:v hevc_qsv -b:v 1300k -minrate 975k -maxrate 1625k -bufsize 2152k -preset slow -global_quality 22 -low_power 1 -g 120 -bf 4 -extbrc 1 -rdo 1 -mbbrc 1 -b_strategy 1 -adaptive_i 1 -adaptive_b 1 -look_ahead_depth 60 -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -f matroska -profile:v main10 -vf scale_qsv=format=p010le,hwupload=extra_hw_frames=64,format=qsv "output.mkv"
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
Input #0, matroska,webm, from 'input.mkv':
Metadata:
ENCODER : Lavf61.3.104
Duration: 00:06:00.21, start: 0.000000, bitrate: 10004 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn (default)
Metadata:
BPS : 8279063
NUMBER_OF_FRAMES: 107940
NUMBER_OF_BYTES : 4654386016
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.208000000
Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 576 kb/s (default)
Metadata:
BPS : 576000
NUMBER_OF_FRAMES: 140548
NUMBER_OF_BYTES : 323822592
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.000000000
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English (SDH)
BPS : 46
NUMBER_OF_FRAMES: 947
NUMBER_OF_BYTES : 24642
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:05:57.458000000
File 'output.mkv' already exists. Overwrite? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_qsv) -> hevc (hevc_qsv))
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
Output #0, matroska, to 'output.mkv':
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Video: hevc, qsv(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 1300 kb/s, 24 fps, 1k tbn (default)
Metadata:
BPS : 8279063
NUMBER_OF_FRAMES: 107940
NUMBER_OF_BYTES : 4654386016
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.208000000
encoder : Lavc60.3.100 hevc_qsv
Side data:
cpb: bitrate max/min/avg: 1625000/975000/1300000 buffer size: 2152000 vbv_delay: N/A
Stream #0:1(eng): Audio: eac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 576 kb/s (default)
Metadata:
BPS : 576000
NUMBER_OF_FRAMES: 140548
NUMBER_OF_BYTES : 323822592
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.000000000
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English (SDH)
BPS : 46
NUMBER_OF_FRAMES: 947
NUMBER_OF_BYTES : 24642
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:05:57.458000000
[matroska @ 0x603cbf07ab80] Non-monotonous DTS in output stream 0:0; previous: 359958, current: 359875; changing to 359958. This may result in incorrect timestamps in the output file.
[matroska @ 0x603cbf07ab80] Non-monotonous DTS in output stream 0:0; previous: 359958, current: 359917; changing to 359958. This may result in incorrect timestamps in the output file.
frame= 8594 fps=106 q=-0.0 Lsize= 81372kB time=00:05:59.96 bitrate=1851.8kbits/s speed=4.44x
video:55906kB audio:25312kB subtitle:1kB other streams:0kB global headers:0kB muxing overhead: 0.188361%
root@b3010456a8fd:/photos# ffmpeg -fflags +genpts -hwaccel qsv -hwaccel_output_format qsv -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v hevc_qsv -i "output.mkv" -map 0 -c:v hevc_qsv -b:v 1300k -minrate 975k -maxrate 1625k -bufsize 2152k -preset slow -global_quality 22 -low_power 1 -g 120 -bf 4 -extbrc 1 -rdo 1 -mbbrc 1 -b_strategy 1 -adaptive_i 1 -adaptive_b 1 -look_ahead_depth 60 -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -f matroska -profile:v main10 -vf scale_qsv=format=p010le,hwupload=extra_hw_frames=64,format=qsv "output2.mkv"
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
Input #0, matroska,webm, from 'output.mkv':
Metadata:
ENCODER : Lavf60.3.100
Duration: 00:06:00.21, start: 0.000000, bitrate: 1850 kb/s
Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn (default)
Metadata:
BPS : 8279063
NUMBER_OF_FRAMES: 107940
NUMBER_OF_BYTES : 4654386016
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
ENCODER : Lavc60.3.100 hevc_qsv
DURATION : 00:06:00.209000000
Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 576 kb/s (default)
Metadata:
BPS : 576000
NUMBER_OF_FRAMES: 140548
NUMBER_OF_BYTES : 323822592
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.000000000
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English (SDH)
BPS : 46
NUMBER_OF_FRAMES: 947
NUMBER_OF_BYTES : 24642
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:05:57.458000000
Stream mapping:
Stream #0:0 -> #0:0 (hevc (hevc_qsv) -> hevc (hevc_qsv))
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
Output #0, matroska, to 'output2.mkv':
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Video: hevc, qsv(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 1300 kb/s, 24 fps, 1k tbn (default)
Metadata:
BPS : 8279063
NUMBER_OF_FRAMES: 107940
NUMBER_OF_BYTES : 4654386016
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.209000000
encoder : Lavc60.3.100 hevc_qsv
Side data:
cpb: bitrate max/min/avg: 1625000/975000/1300000 buffer size: 2152000 vbv_delay: N/A
Stream #0:1(eng): Audio: eac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 576 kb/s (default)
Metadata:
BPS : 576000
NUMBER_OF_FRAMES: 140548
NUMBER_OF_BYTES : 323822592
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.000000000
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English (SDH)
BPS : 46
NUMBER_OF_FRAMES: 947
NUMBER_OF_BYTES : 24642
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:05:57.458000000
[matroska @ 0x61ddb8a17880] Non-monotonous DTS in output stream 0:0; previous: 359958, current: 359875; changing to 359958. This may result in incorrect timestamps in the output file.
[matroska @ 0x61ddb8a17880] Non-monotonous DTS in output stream 0:0; previous: 359958, current: 359917; changing to 359958. This may result in incorrect timestamps in the output file.
frame= 8594 fps=103 q=-0.0 Lsize= 81150kB time=00:05:59.96 bitrate=1846.8kbits/s speed=4.31x
video:55683kB audio:25312kB subtitle:1kB other streams:0kB global headers:0kB muxing overhead: 0.188935%
I then logged in as the user abc. Which also works:
abc@b3010456a8fd:/photos$ ffmpeg -fflags +genpts -hwaccel qsv -hwaccel_output_format qsv -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv -i "input.mkv" -map 0 -c:v hevc_qsv -b:v 1300k -minrate 975k -maxrate 1625k -bufsize 2152k -preset slow -global_quality 22 -low_power 1 -g 120 -bf 4 -extbrc 1 -rdo 1 -mbbrc 1 -b_strategy 1 -adaptive_i 1 -adaptive_b 1 -look_ahead_depth 60 -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -f matroska -profile:v main10 -vf scale_qsv=format=p010le,hwupload=extra_hw_frames=64,format=qsv "output3.mkv"
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
Input #0, matroska,webm, from 'input.mkv':
Metadata:
ENCODER : Lavf61.3.104
Duration: 00:06:00.21, start: 0.000000, bitrate: 10004 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn (default)
Metadata:
BPS : 8279063
NUMBER_OF_FRAMES: 107940
NUMBER_OF_BYTES : 4654386016
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.208000000
Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 576 kb/s (default)
Metadata:
BPS : 576000
NUMBER_OF_FRAMES: 140548
NUMBER_OF_BYTES : 323822592
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.000000000
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English (SDH)
BPS : 46
NUMBER_OF_FRAMES: 947
NUMBER_OF_BYTES : 24642
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:05:57.458000000
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_qsv) -> hevc (hevc_qsv))
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
Output #0, matroska, to 'output3.mkv':
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Video: hevc, qsv(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 1300 kb/s, 24 fps, 1k tbn (default)
Metadata:
BPS : 8279063
NUMBER_OF_FRAMES: 107940
NUMBER_OF_BYTES : 4654386016
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.208000000
encoder : Lavc60.3.100 hevc_qsv
Side data:
cpb: bitrate max/min/avg: 1625000/975000/1300000 buffer size: 2152000 vbv_delay: N/A
Stream #0:1(eng): Audio: eac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 576 kb/s (default)
Metadata:
BPS : 576000
NUMBER_OF_FRAMES: 140548
NUMBER_OF_BYTES : 323822592
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.000000000
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English (SDH)
BPS : 46
NUMBER_OF_FRAMES: 947
NUMBER_OF_BYTES : 24642
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:05:57.458000000
[matroska @ 0x5b0e9a17ef00] Non-monotonous DTS in output stream 0:0; previous: 359958, current: 359875; changing to 359958. This may result in incorrect timestamps in the output file.
[matroska @ 0x5b0e9a17ef00] Non-monotonous DTS in output stream 0:0; previous: 359958, current: 359917; changing to 359958. This may result in incorrect timestamps in the output file.
frame= 8594 fps=123 q=-0.0 Lsize= 81372kB time=00:05:59.96 bitrate=1851.8kbits/s speed=5.17x
video:55906kB audio:25312kB subtitle:1kB other streams:0kB global headers:0kB muxing overhead: 0.188361%
Via immich webui same issues as before 🤷♂️ sorry for spamming this btw but I'm trying to build up to something 😄:
immich | [Nest] 169 - 06/13/2024, 11:20:23 PM LOG [Microservices:MediaService] Started encoding video 66e2272e-7e02-49f2-9e90-2206f0b3b149 {"inputOptions":["-init_hw_device qsv=hw","-filter_hw_device hw"],"outputOptions":["-c:v hevc_qsv","-c:a copy","-movflags faststart","-fps_mode passthrough","-map 0:0","-map 0:1","-bf 0","-refs 5","-g 256","-tag:v hvc1","-v verbose","-vf zscale=t=linear:npl=100,tonemap=hable:desat=0,zscale=p=bt709:t=bt709:m=bt709:range=pc,format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:1080","-preset 3","-threads 3","-global_quality:v 31","-maxrate 3500","-bufsize 7000"],"twoPass":false}
immich | [Nest] 169 - 06/13/2024, 11:20:23 PM ERROR [Microservices:MediaRepository] ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
immich | built with gcc 12 (Debian 12.2.0-14)
immich | configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
immich | libavutil 58. 2.100 / 58. 2.100
immich | libavcodec 60. 3.100 / 60. 3.100
immich | libavformat 60. 3.100 / 60. 3.100
immich | libavdevice 60. 1.100 / 60. 1.100
immich | libavfilter 9. 3.100 / 9. 3.100
immich | libswscale 7. 1.100 / 7. 1.100
immich | libswresample 4. 10.100 / 4. 10.100
immich | libpostproc 57. 1.100 / 57. 1.100
immich | [AVHWDeviceContext @ 0x218560c02c0] Cannot open DRM render node for device 0.
immich | [AVHWDeviceContext @ 0x218560c02c0] Cannot open DRM render node for device 1.
immich | [AVHWDeviceContext @ 0x218560c02c0] Cannot open DRM render node for device 2.
immich | [AVHWDeviceContext @ 0x218560c02c0] Cannot open DRM render node for device 3.
immich | [AVHWDeviceContext @ 0x218560c02c0] Cannot open DRM render node for device 4.
immich | [AVHWDeviceContext @ 0x218560c02c0] Cannot open DRM render node for device 5.
immich | [AVHWDeviceContext @ 0x218560c02c0] Cannot open DRM render node for device 6.
immich | [AVHWDeviceContext @ 0x218560c02c0] Cannot open DRM render node for device 7.
immich | [AVHWDeviceContext @ 0x218560c02c0] No VA display found for any default device.
immich | Device creation failed: -22.
immich | Failed to set value 'qsv=hw' for option 'init_hw_device': Invalid argument
immich | Error parsing global options: Invalid argument
immich |
immich | [Nest] 169 - 06/13/2024, 11:20:23 PM ERROR [Microservices:MediaService] Error: ffmpeg exited with code 1: Device creation failed: -22.
immich | Failed to set value 'qsv=hw' for option 'init_hw_device': Invalid argument
immich | Error parsing global options: Invalid argument
immich |
immich | [Nest] 169 - 06/13/2024, 11:20:23 PM ERROR [Microservices:MediaService] Error occurred during transcoding. Retrying with QSV acceleration disabled.
immich | [Nest] 229 - 06/13/2024, 11:20:31 PM LOG [Api:EventRepository] Websocket Disconnect:
so these were the settings immich used that produced the error Cannot open DRM render node for device
etc.:
7e02-49f2-9e90-2206f0b3b149 {"inputOptions":["-init_hw_device qsv=hw","-filter_hw_device hw"],"outputOptions":["-c:v hevc_qsv","-c:a copy","-movflags faststart","-fps_mode passthrough","-map 0:0","-map 0:1","-bf 0","-refs 5","-g 256","-tag:v hvc1","-v verbose","-vf zscale=t=linear:npl=100,tonemap=hable:desat=0,zscale=p=bt709:t=bt709:m=bt709:range=pc,format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:1080","-preset 3","-threads 3","-global_quality:v 31","-maxrate 3500","-bufsize 7000"],"twoPass":false}
So I reproduced them via terminal as user abc in the immich container:
ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -i "output.mkv" -c:v hevc_qsv -c:a copy -movflags faststart -fps_mode passthrough -map 0:0 -map 0:1 -bf 0 -refs 5 -g 256 -tag:v hvc1 -v verbose -vf zscale=t=linear:npl=100,tonemap=hable:desat=0,zscale=p=bt709:t=bt709:m=bt709:range=pc,format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:1080 -preset 3 -threads 3 -global_quality:v 31 -maxrate 3500 -bufsize 7000 "output5.mkv"
and of course it works 🤡
abc@b3010456a8fd:/photos$ ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -i "output.mkv" -c:v hevc_qsv -c:a copy -movflags faststart -fps_mode passthrough -map 0:0 -map 0:1 -bf 0 -refs 5 -g 256 -tag:v hvc1 -v verbose -vf zscale=t=linear:npl=100,tonemap=hable:desat=0,zscale=p=bt709:t=bt709:m=bt709:range=pc,format=nv12,hwupload=extra_hw_frames=64,scale_qsv=-1:1080 -preset 3 -threads 3 -global_quality:v 31 -maxrate 3500 -bufsize 7000 "output5.mkv"
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
[AVHWDeviceContext @ 0x572eb2c18e00] Trying to use DRM render node for device 0, with matching kernel driver (i915).
[AVHWDeviceContext @ 0x572eb2c18e00] libva: VA-API version 1.21.0
[AVHWDeviceContext @ 0x572eb2c18e00] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x572eb2c18e00] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x572eb2c18e00] libva: Found init function __vaDriverInit_1_21
[AVHWDeviceContext @ 0x572eb2c18e00] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x572eb2c18e00] Initialised VAAPI connection: version 1.21
[AVHWDeviceContext @ 0x572eb2c18e00] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.1 (0593864).
[AVHWDeviceContext @ 0x572eb2c18e00] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x572eb2c18c00] Use Intel(R) oneVPL to create MFX session, API version is 2.10, the required implementation version is 1.3
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
[AVHWDeviceContext @ 0x572eb2c18c00] Initialize MFX session: implementation version is 2.10
Input #0, matroska,webm, from 'output.mkv':
Metadata:
ENCODER : Lavf60.3.100
Duration: 00:06:00.21, start: 0.000000, bitrate: 1850 kb/s
Stream #0:0: Video: hevc (Main 10), 1 reference frame, yuv420p10le(tv, bt709, progressive, left), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn (default)
Metadata:
BPS : 8279063
NUMBER_OF_FRAMES: 107940
NUMBER_OF_BYTES : 4654386016
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
ENCODER : Lavc60.3.100 hevc_qsv
DURATION : 00:06:00.209000000
Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 576 kb/s (default)
Metadata:
BPS : 576000
NUMBER_OF_FRAMES: 140548
NUMBER_OF_BYTES : 323822592
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.000000000
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English (SDH)
BPS : 46
NUMBER_OF_FRAMES: 947
NUMBER_OF_BYTES : 24642
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:05:57.458000000
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> hevc (hevc_qsv))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x572eb5dac7c0] w:1920 h:1080 pixfmt:yuv420p10le tb:1/1000 fr:24/1 sar:1/1
[auto_scale_0 @ 0x572eb5dae340] w:iw h:ih flags:'' interl:0
[Parsed_format_3 @ 0x572eb2f5b340] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_zscale_2' and the filter 'Parsed_format_3'
[auto_scale_0 @ 0x572eb5dae340] w:1920 h:1080 fmt:gbrpf32le sar:1/1 -> w:1920 h:1080 fmt:nv12 sar:1/1 flags:0x00000004
[AVHWDeviceContext @ 0x572eb5ee1300] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.1 (0593864).
[AVHWDeviceContext @ 0x572eb5ee1300] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x572eb5f4b1c0] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.1 (0593864).
[AVHWDeviceContext @ 0x572eb5f4b1c0] Driver not found in known nonstandard list, using standard behaviour.
[Parsed_scale_qsv_5 @ 0x572eb2f5b800] Use Intel(R) oneVPL to create MFX session with the specified MFX loader
[Parsed_scale_qsv_5 @ 0x572eb2f5b800] VPP: input is video memory surface
[Parsed_scale_qsv_5 @ 0x572eb2f5b800] VPP: output is video memory surface
[auto_scale_0 @ 0x572eb5dae340] w:1920 h:1080 fmt:gbrpf32le sar:1/1 -> w:1920 h:1080 fmt:nv12 sar:1/1 flags:0x00000004
Last message repeated 2 times
[AVHWFramesContext @ 0x572eb5eee4c0] Use Intel(R) oneVPL to create MFX session, API version is 2.10, the required implementation version is 2.10
[AVHWFramesContext @ 0x572eb5eee4c0] Initialize MFX session: implementation version is 2.10
[hevc_qsv @ 0x572eb2f27040] Using input frames context (format qsv) with hevc_qsv encoder.
[hevc_qsv @ 0x572eb2f27040] Encoder: input is video memory surface
[hevc_qsv @ 0x572eb2f27040] Use Intel(R) oneVPL to create MFX session with the specified MFX loader
[hevc_qsv @ 0x572eb2f27040] Using the constant quality with VBR algorithm (QVBR) ratecontrol method
[hevc_qsv @ 0x572eb2f27040] profile: hevc main; level: 40
[hevc_qsv @ 0x572eb2f27040] GopPicSize: 256; GopRefDist: 1; GopOptFlag:; IdrInterval: 1
[hevc_qsv @ 0x572eb2f27040] TargetUsage: 4; RateControlMethod: QVBR
[hevc_qsv @ 0x572eb2f27040] NumSlice: 1; NumRefFrame: 5
[hevc_qsv @ 0x572eb2f27040] RateDistortionOpt: unknown
[hevc_qsv @ 0x572eb2f27040] RecoveryPointSEI: unknown
[hevc_qsv @ 0x572eb2f27040] VDENC: OFF
[hevc_qsv @ 0x572eb2f27040] NalHrdConformance: ON; VuiNalHrdParameters: ON
[hevc_qsv @ 0x572eb2f27040] FrameRateExtD: 1; FrameRateExtN: 24
[hevc_qsv @ 0x572eb2f27040] IntRefType: 0; IntRefCycleSize: 0; IntRefQPDelta: 0
[hevc_qsv @ 0x572eb2f27040] MaxFrameSize: 0; MaxSliceSize: 0
[hevc_qsv @ 0x572eb2f27040] BitrateLimit: unknown; MBBRC: unknown; ExtBRC: OFF
[hevc_qsv @ 0x572eb2f27040] Trellis: auto
[hevc_qsv @ 0x572eb2f27040] RepeatPPS: OFF; NumMbPerSlice: 0; LookAheadDS: unknown
[hevc_qsv @ 0x572eb2f27040] AdaptiveI: unknown; AdaptiveB: unknown; BRefType:off
[hevc_qsv @ 0x572eb2f27040] MinQPI: 1; MaxQPI: 51; MinQPP: 1; MaxQPP: 51; MinQPB: 1; MaxQPB: 51
[hevc_qsv @ 0x572eb2f27040] DisableDeblockingIdc: 0
[hevc_qsv @ 0x572eb2f27040] SkipFrame: no_skip
[hevc_qsv @ 0x572eb2f27040] QVBRQuality: 31
[hevc_qsv @ 0x572eb2f27040] PRefType: simple
[hevc_qsv @ 0x572eb2f27040] GPB: ON
[hevc_qsv @ 0x572eb2f27040] TransformSkip: ON
[hevc_qsv @ 0x572eb2f27040] IntRefCycleDist: 0
[hevc_qsv @ 0x572eb2f27040] LowDelayBRC: OFF
[hevc_qsv @ 0x572eb2f27040] MaxFrameSizeI: 0; MaxFrameSizeP: 0
[hevc_qsv @ 0x572eb2f27040] ScenarioInfo: 0
[hevc_qsv @ 0x572eb2f27040] NumTileColumns: 1; NumTileRows: 1
Output #0, matroska, to 'output5.mkv':
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Video: hevc, 1 reference frame (hvc1 / 0x31637668), qsv(tv, unknown/bt709/bt709, progressive), 1920x1080 (0x0) [SAR 1:1 DAR 16:9], q=2-31, 1000 kb/s, 24 fps, 1k tbn (default)
Metadata:
BPS : 8279063
NUMBER_OF_FRAMES: 107940
NUMBER_OF_BYTES : 4654386016
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.209000000
encoder : Lavc60.3.100 hevc_qsv
Side data:
cpb: bitrate max/min/avg: 3500/0/1000000 buffer size: 7000 vbv_delay: N/A
Stream #0:1(eng): Audio: eac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 576 kb/s (default)
Metadata:
BPS : 576000
NUMBER_OF_FRAMES: 140548
NUMBER_OF_BYTES : 323822592
_STATISTICS_WRITING_APP: mkvmerge v80.0 ('Roundabout') 64-bit
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:06:00.000000000
EOF in input file 0 q=-0.0 size= 42240kB time=00:05:58.72 bitrate= 964.6kbits/s speed=1.15x
Terminating demuxer thread 0
No more output streams to write to, finishing.e=00:05:59.96 bitrate= 961.3kbits/s speed=1.16x
[out#0/matroska @ 0x572eb2ee7900] All streams finished
[out#0/matroska @ 0x572eb2ee7900] Terminating muxer thread
[AVIOContext @ 0x572eb2f2bd40] Statistics: 44239435 bytes written, 2 seeks, 170 writeouts
frame= 8594 fps= 28 q=-0.0 Lsize= 43201kB time=00:06:00.16 bitrate= 982.6kbits/s speed=1.16x
video:17741kB audio:25312kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.343199%
Input file #0 (output.mkv):
Input stream #0:0 (video): 8594 packets read (57255922 bytes); 8594 frames decoded;
Input stream #0:1 (audio): 11250 packets read (25920000 bytes);
Input stream #0:2 (subtitle): 0 packets read (0 bytes);
Total: 19844 packets (83175922 bytes) demuxed
Output file #0 (output5.mkv):
Output stream #0:0 (video): 8594 frames encoded; 8594 packets muxed (18166939 bytes);
Output stream #0:1 (audio): 11250 packets muxed (25920000 bytes);
Total: 19844 packets (44086939 bytes) muxed
[AVIOContext @ 0x572eb2ec4180] Statistics: 83325307 bytes read, 0 seeks
So maybe the ffmpeg cmd is parsed badly within immich, or have I overlooked something? I mean feature and permission wise everything seems to be in working order doesn't it?
I just tried again with the current openvino-v1.108.0-ig10 and transcoding with the UHD770 just works™ now. I didn't change anything since the last time regarding settings. Except for using openvino-v1.108.0-ig10 and updating the ubuntu host to 24.04 with kernel 6.9. So I'm going to close this one. 😅👍
[Nest] 285 - 07/12/2024, 11:23:41 AM LOG [Microservices:MediaService] Started encoding video 6729068b-25ee-4350-8d4e-5b3ae2531f41 {"inputOptions":["-hwaccel qsv","-hwaccel_output_format qsv","-async_depth 4","-noautorotate","-threads 1"],"outputOptions":["-c:v hevc_qsv","-c:a copy","-movflags faststart","-fps_mode passthrough","-map 0:0","-bf 5","-refs 6","-g 256","-tag:v hvc1","-v verbose","-vf scale_qsv=-1:1080:async_depth=4:mode=hq:format=nv12","-preset 2","-threads 2","-global_quality:v 30"],"twoPass":false}
[Nest] 285 - 07/12/2024, 11:23:47 AM LOG [Microservices:MediaService] Successfully encoded 6729068b-25ee-4350-8d4e-5b3ae2531f41
Hello and best regards!🙋♂️ Wanted to give quicksync transcoding a try again, since it's much more power efficient. Has been a while since the last time. System has a 13600k with an UHD770. I'm on v1.106.2-ig287. Otherwise on Ubuntu 23.10 with Kernel 6.7. Just fyi as Plex seems to have some problems since 24.04 with Kernel 6.8 https://forums.plex.tv/t/ubuntu-24-04-hw-transcoding/873765
Also tried vaapi to the same effect.
Maybe similar to this https://github.com/imagegenius/docker-immich/pull/168 , maybe I've overlooked something🤷♂️
edit: Just from a quick search maybe related https://github.com/jellyfin/jellyfin/issues/11485 https://github.com/MekayelAnik/ispyagentdvr-docker/issues/12 https://github.com/jellyfin/jellyfin-ffmpeg/issues/297
edit 2: installed vainfo in the immich container:
edit 3: permissions in immich docker:
docker error log:
HW Transcode Settings in immich:
relevant docker compose:
tried a bunch of different hw transcode settings, also removing
- /dev/dri/renderD128:/dev/dri/renderD128
from the compose file.