Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue]: Trickplay image generation failing #11556

Closed
1 task done
ericswpark opened this issue May 12, 2024 · 6 comments
Closed
1 task done

[Issue]: Trickplay image generation failing #11556

ericswpark opened this issue May 12, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@ericswpark
Copy link

Please describe your bug

Running the trickplay image generation task causes the attached log output.

Reproduction Steps

  1. Enable trickplay image generation on libraries
  2. Run the scheduled task
  3. Observe logs

Jellyfin Version

10.9.0

if other:

No response

Environment

- OS: Unraid
- Linux Kernel: 6.1.79-Unraid
- Virtualization: Docker
- Clients: Browser
- Browser: Chrome 124.0.6367.202 (Official Build) (64-bit) (cohort: M124 Rollout) 
- FFmpeg Version: ffmpeg version 6.0.1-Jellyfin 
- Playback Method: N/A
- Hardware Acceleration: VAAPI
- GPU Model: AMD Ryzen 5 PRO 4650G with Radeon Graphics
- Plugins: AniDB, AudioDB, jellyscrub, MusicBrainz, OMDb, Open Subtitles, Playback Reporting, Reports, Studio Images, Subtitle Extract, TMDb, TMDb Trailers, Trakt, Webhook
- Reverse Proxy: nginx
- Base URL: none
- Networking: Bridge/NAT
- Storage: local

Jellyfin logs

[2024-05-12 18:27:00.886 +09:00] [INF] [41] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Creating trickplay files at 320 width, for "/data/media/TVShows/Demo/test.mp4" [ID: 9859214e-8bfc-87c4-a04e-642cf2f6f57d]
[2024-05-12 18:27:00.886 +09:00] [INF] [41] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: "/usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -init_hw_device drm=dr:/dev/dri/renderD128 -init_hw_device vaapi=va@dr -init_hw_device vulkan=vk@dr -filter_hw_device vk -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i file:\"/data/media/Demo/test.mp4\" -noautoscale -an -sn -vf \"fps=0.5,setparams=color_primaries=bt2020:color_trc=smpte2084:colorspace=bt2020nc,hwmap=derive_device=vulkan,format=vulkan,libplacebo=upscaler=none:downscaler=none:w=320:h=146:format=bgra:tonemapping=bt.2390:peak_detect=0:color_primaries=bt709:color_trc=bt709:colorspace=bt709,hwmap=derive_device=vaapi,format=vaapi,scale_vaapi=format=nv12\" -threads 1 -c:v mjpeg_vaapi -qscale:v 4 -f image2 \"/config/cache/temp/8ceea609869e46e681dcaeff4282d38d/%08d.jpg\""
[2024-05-12 18:27:01.667 +09:00] [ERR] [39] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Error creating trickplay images.
System.ArgumentException: Can't create trickplay from 0 images.
   at Jellyfin.Server.Implementations.Trickplay.TrickplayManager.CreateTiles(List`1 images, Int32 width, TrickplayOptions options, String outputDir)
   at Jellyfin.Server.Implementations.Trickplay.TrickplayManager.RefreshTrickplayDataInternal(Video video, Boolean replace, Int32 width, TrickplayOptions options, CancellationToken cancellationToken)

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ericswpark ericswpark added the bug Something isn't working label May 12, 2024
@ericswpark ericswpark changed the title [Issue]: trickplay image generation failing [Issue]: Trickplay image generation failing May 12, 2024
@gnattu
Copy link
Member

gnattu commented May 12, 2024

Try disable hardware encoding for trickplay and see if it would success.

@jellyfin-bot jellyfin-bot added this to Needs triage in Issue Triage for Main Repo May 12, 2024
@ericswpark
Copy link
Author

@gnattu thanks, seems like the following option was the culprit:

image

Unchecked it and ran the task again and now it's progressing fine.

I am using VAAPI though; maybe an incompatibility with AMD GPUs? Feel free to close the issue if this is intended behavior.

@gnattu
Copy link
Member

gnattu commented May 12, 2024

The mjpeg encoder has a very limited hardware platform support, and I don't think it is compatible with anything but Intel atm.

@gnattu
Copy link
Member

gnattu commented May 13, 2024

Closing as hardware compatibility issue

@gnattu gnattu closed this as completed May 13, 2024
Issue Triage for Main Repo automation moved this from Needs triage to Closed/Done May 13, 2024
@mcronce
Copy link

mcronce commented May 15, 2024

@gnattu I'm seeing this using an Intel GPU (A380) with 10.9.1 when hardware encoding is enabled - for whatever reason, though, I'm seeing ffmpeg's stderr in logs. The error I'm seeing is [mjpeg_vaapi @ 0x557871ed2480] Invalid quality value 472 (must be 1-100). Is there anything actionable that could be done (on Jellyfin's side) to fix this or is it just a matter of needing to leave hardware encoding off until the hardware encoder matures?

FWIW, execing into the container and manually running the ffmpeg command with lower qscale values does yield changes, but the only value that works is 0, which isn't even in the documented valid range for that value (1-31). 1 still yields Invalid quality value 118 (must be 1-100)

@gnattu
Copy link
Member

gnattu commented May 15, 2024

@gnattu I'm seeing this using an Intel GPU (A380) with 10.9.1 when hardware encoding is enabled - for whatever reason, though, I'm seeing ffmpeg's stderr in logs. The error I'm seeing is [mjpeg_vaapi @ 0x557871ed2480] Invalid quality value 472 (must be 1-100). Is there anything actionable that could be done (on Jellyfin's side) to fix this or is it just a matter of needing to leave hardware encoding off until the hardware encoder matures?

FWIW, execing into the container and manually running the ffmpeg command with lower qscale values does yield changes, but the only value that works is 0, which isn't even in the documented valid range for that value (1-31). 1 still yields Invalid quality value 118 (must be 1-100)

Hardware encoders use different definition of quality. For VAAPI, what you are specifying is the quant and will be multiplied by 118 to get the real quality but that one ranges from 1-100. Such conversion probably should be handled by server otherwise the user can only use the default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

3 participants