[10.11.0] HW accel trickplay not respecting threads #7431

Closed
opened 2026-02-07 04:55:25 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @alex-stout on GitHub (Oct 20, 2025).

On new version 10.11.0.

I set thread count but my log has two thread args. The server seems to be only respecting the first.

Link to (I think the culprit line. It should strip out existing thread from the string):

1a1a24cfff/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs (L912)

Originally created by @alex-stout on GitHub (Oct 20, 2025). On new version 10.11.0. I set thread count but my log has two thread args. The server seems to be only respecting the first. Link to (I think the culprit line. It should strip out existing thread from the string): https://github.com/jellyfin/jellyfin/blob/1a1a24cfffb1e48577c177dd1642c46d0eb39dc0/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs#L912
Author
Owner

@nyanmisaka commented on GitHub (Oct 20, 2025):

Unlike software transcoding, hardware decoders generally don't support thread count, or setting a higher thread count doesn't yield any benefit but increases VRAM usage. Some HWA methods require two threads to avoid deadlock, so we set this internally based on experience.

@nyanmisaka commented on GitHub (Oct 20, 2025): Unlike software transcoding, hardware decoders generally don't support thread count, or setting a higher thread count doesn't yield any benefit but increases VRAM usage. Some HWA methods require two threads to avoid deadlock, so we set this internally based on experience.
Author
Owner

@alex-stout commented on GitHub (Oct 20, 2025):

Gotcha. Thought I've seen multi-processes hitting the GPU before when generating trickplay images in the past.

So this log is expected with two threads args?

MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: /usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -skip_frame nokey -init_hw_device cuda=cu:0 -filter_hw_device cu -hwaccel cuda -hwaccel_output_format cuda -noautorotate -hwaccel_flags +unsafe_output -threads 1 -i file:"/ocean.mkv" -noautoscale -an -sn -vf "fps=0.10000000149011612,setparams=color_primaries=bt2020:color_trc=smpte2084:colorspace=bt2020nc,scale_cuda=w=320:h=180,tonemap_cuda=format=yuv420p:p=bt709:t=bt709:m=bt709:tonemap=bt2390:peak=100:desat=0:range=pc,hwdownload,format=yuv420p" -threads 20 -c:v mjpeg -qscale:v 3 -fps_mode passthrough -f image2 "/tmp/jellyfin/0fe3f510014a4135931a8b296726b167/%08d.jpg"
@alex-stout commented on GitHub (Oct 20, 2025): Gotcha. Thought I've seen multi-processes hitting the GPU before when generating trickplay images in the past. So this log is expected with two `threads` args? ``` MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: /usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -skip_frame nokey -init_hw_device cuda=cu:0 -filter_hw_device cu -hwaccel cuda -hwaccel_output_format cuda -noautorotate -hwaccel_flags +unsafe_output -threads 1 -i file:"/ocean.mkv" -noautoscale -an -sn -vf "fps=0.10000000149011612,setparams=color_primaries=bt2020:color_trc=smpte2084:colorspace=bt2020nc,scale_cuda=w=320:h=180,tonemap_cuda=format=yuv420p:p=bt709:t=bt709:m=bt709:tonemap=bt2390:peak=100:desat=0:range=pc,hwdownload,format=yuv420p" -threads 20 -c:v mjpeg -qscale:v 3 -fps_mode passthrough -f image2 "/tmp/jellyfin/0fe3f510014a4135931a8b296726b167/%08d.jpg" ```
Author
Owner

@nyanmisaka commented on GitHub (Oct 20, 2025):

Yes, that is normal. The former is for hardware decoder, and the latter is for software encoder.

@nyanmisaka commented on GitHub (Oct 20, 2025): Yes, that is normal. The former is for hardware decoder, and the latter is for software encoder.
Author
Owner

@alex-stout commented on GitHub (Oct 20, 2025):

Cool thanks.

@alex-stout commented on GitHub (Oct 20, 2025): Cool thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#7431