mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #12744] [MERGED] Add perf tradeoff mode to image extractor #13350
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/12744
Author: @gnattu
Created: 9/29/2024
Status: ✅ Merged
Merged: 9/30/2024
Merged by: @crobibero
Base:
master← Head:imgext-perf-tradeoff📝 Commits (1)
3e95bebAdd perf tradeoff mode to image extractor📊 Changes
3 files changed (+22 additions, -1 deletions)
View changed files
📝
Emby.Server.Implementations/ConfigurationOptions.cs(+1 -0)📝
MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs(+13 -0)📝
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs(+8 -1)📄 Description
On low-end CPUs, image extraction can be quite slow because the CPU has to decode and analyze 24 frames to pick the best one. If the input is an HDR image, it also needs to perform tone mapping. On a Raspberry Pi 4 level of performance, this usually means more than 10 seconds per image extracted, and for 4K HDR inputs, it may even timeout. This PR adds a tradeoff mode where the extracted image is the single frame that was picked. Ideally it would come from one of the key frame which is very fast to extract, but if that failed it will fallback to extract the slower normal frame. The frame picked by this mode is worse and less representative, but the process is significantly faster.
Another benefit of this mode is that there is no longer the need to pool and cache lots of frames in the memory, which might also be helpful in low-memory scenarios.
Users can activate this mode by export env var:
Changes
Issues
Might make users like #12740 happier.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.