Closed guilty-p01nt3r closed 1 year ago
According to the logs, HWA is working fine.
HWA does not equal to zero CPU utilization, and your audio still needs to be transcoded by the CPU. However I don't understand how this leads to CPU skyrockets.
Stream #0:1 -> #0:1 (ac3 (native) -> aac (libfdk_aac))
I checked while watching something on the phone. It is indeed using HWA through ffmpeg on the GPU. But the CPU usage is still quite high. (The skyrocketing happens more when It's transcoding a newly added movie)
I'll investigate what task is this CPU intensive. If anyone has some ideas, I can provide more data and logs.
Here some monitoring while watching something from the phone:
Can you see what's the (ffmpeg
) command that's being run? I'd assume that it'd be quite useful to know.
Yeah sure. I just launched a movie with quality selected lower than the original
The command is this beast over here:
ffmpeg \
-analyzeduration 200M \
-ss 00:10:33.000 \
-init_hw_device vaapi=va:/dev/dri/renderD128 \
-filter_hw_device va \
-hwaccel vaapi \
-autorotate 0 \
-canvas_size 1920x1080 \
-i file:/mnt/1TB_Disk/tv_service/containerized/media/radarr/data/Resident Evil Death Island (2023)/Resident Evil Death Island (2023) Unknown.m2ts \
-autoscale 0 \
-map_metadata -1 \
-map_chapters -1 \
-threads 0 \
-map 0:0 \
-map 0:2 \
-map \
-0:0 \
-codec:v:0 h264_vaapi \
-rc_mode VBR \
-b:v 77607191 \
-maxrate 77607191 \
-bufsize 155214382 \
-force_key_frames:0 expr:gte(t,633+n_forced*3) \
-filter_complex [0:9]scale=s=3840x2160:flags=fast_bilinear[sub];[0:0]setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,min(3840\,2160*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(3840/a\,2160))/2)*2,format=nv12[main];[main][sub]overlay=eof_action=endall:shortest=1:repeatlast=0,hwupload=derive_device=vaapi \
-start_at_zero \
-codec:a:0 aac \
-ac 2 \
-ab 384000 \
-af volume=2 \
-copyts \
-avoid_negative_ts disabled \
-max_muxing_queue_size 2048 \
-f hls \
-max_delay 5000000 \
-hls_time 3 \
-hls_segment_type mpegts \
-start_number 211 \
-hls_segment_filename /mnt/1TB_Disk/jellyfin/config/transcodes/962e7866feb7135f530d64ff85d1248e%d.ts \
-hls_playlist_type vod \
-hls_list_size 0 \
-y /mnt/1TB_Disk/jellyfin/config/transcodes/962e7866feb7135f530d64ff85d1248e.m3u8
It seems the jellyfin-ffmpeg was not used for transcoding. Set ffmpeg path to/usr/lib/jellyfin-ffmpeg/ffmpeg
and try again.
https://jellyfin.org/docs/general/administration/hardware-acceleration/amd#arch-linux
Uh sorry about that, I was testing other instances of ffmpeg and forgot to switch back:
here is the command using the default jellyfin-ffmpeg
/usr/lib/jellyfin-ffmpeg/ffmpeg \
-analyzeduration 200M \
-ss 00:13:15.000 \
-init_hw_device vaapi=va:/dev/dri/renderD128 \
-filter_hw_device va \
-hwaccel vaapi \
-hwaccel_output_format vaapi \
-autorotate 0 \
-i file:/mnt/1TB_Disk/tv_service/containerized/media/tv-sonarr/data/Hannibal/Season 1/Hannibal \
- S01E01 \
- Apéritif Bluray-1080p.mkv \
-autoscale 0 \
-map_metadata -1 \
-map_chapters -1 \
-threads 0 \
-map 0:0 \
-map 0:1 \
-map -0:s \
-codec:v:0 h264_vaapi \
-rc_mode VBR \
-b:v 7616000 \
-maxrate 7616000 \
-bufsize 15232000 \
-profile:v:0 high \
-force_key_frames:0 expr:gte(t,795+n_forced*3) \
-vf setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24 \
-codec:a:0 libfdk_aac -ac 2 -ab 384000 -af volume=2 \
-copyts \
-avoid_negative_ts disabled \
-max_muxing_queue_size 2048 -f hls \
-max_delay 5000000 \
-hls_time 3 \
-hls_segment_type mpegts \
-start_number 265 \
-hls_segment_filename /mnt/1TB_Disk/jellyfin/config/transcodes/35d3a08946cb2f7869d6516eec59440c%d.ts \
-hls_playlist_type vod \
-hls_list_size 0 \
-y /mnt/1TB_Disk/jellyfin/config/transcodes/35d3a08946cb2f7869d6516eec59440c.m3u8
I've configured Jellyfin to use hardware acceleration through VAAPI. The problem is that anytime
ffmpeg
transcodes or directStreams the workload on the CPU skyrockets. I've monitored processes on my GPU and its usage throughnvtop
but nothing jellyfin-relatedLet me know if I can debug or get more detailed information
Thanks =)
Here additional useful logs:
Jellyfin is in render and video group:
Jellyfin Version
10.8.z
if other:
No response
Environment
Jellyfin logs
No response
FFmpeg logs
Please attach any browser or client logs here
No response
Please attach any screenshots here
(I've selected
/usr/lib/jellyfin-ffmpeg/ffmpeg
as ffmpeg path )Code of Conduct