[PR #12744] [MERGED] Add perf tradeoff mode to image extractor #13350

Closed
opened 2026-02-07 07:11:25 +03:00 by OVERLORD · 0 comments
Owner

📋 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: masterHead: imgext-perf-tradeoff


📝 Commits (1)

  • 3e95beb Add 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:

export JELLYFIN_FFMPEG__ImgExtractPerfTradeoff=true

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.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/12744 **Author:** [@gnattu](https://github.com/gnattu) **Created:** 9/29/2024 **Status:** ✅ Merged **Merged:** 9/30/2024 **Merged by:** [@crobibero](https://github.com/crobibero) **Base:** `master` ← **Head:** `imgext-perf-tradeoff` --- ### 📝 Commits (1) - [`3e95beb`](https://github.com/jellyfin/jellyfin/commit/3e95beb889e4ba86cd1f452dec429f1b6782cafa) Add perf tradeoff mode to image extractor ### 📊 Changes **3 files changed** (+22 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/ConfigurationOptions.cs` (+1 -0) 📝 `MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs` (+13 -0) 📝 `MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs` (+8 -1) </details> ### 📄 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: ``` export JELLYFIN_FFMPEG__ImgExtractPerfTradeoff=true ``` <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** <!-- Describe your changes here in 1-5 sentences. --> **Issues** <!-- Tag any issues that this PR solves here. ex. Fixes # --> Might make users like #12740 happier. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:11:25 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#13350