[PR #14467] [MERGED] Add fallback for keyframe-only trickplay extraction #13999

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

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/14467
Author: @jkhsjdhjs
Created: 7/14/2025
Status: Merged
Merged: 8/1/2025
Merged by: @Bond-009

Base: masterHead: keyframe-only-trickplay-extraction-fallback


📝 Commits (2)

  • bf3f37e Add fallback for keyframe-only trickplay extraction
  • d6f9375 Add myself to CONTRIBUTORS.md

📊 Changes

2 files changed (+24 additions, -7 deletions)

View changed files

📝 CONTRIBUTORS.md (+1 -0)
📝 MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs (+23 -7)

📄 Description

Keyframe-only trickplay image extraction can fail for some media files. The current behavior is to skip the media file and try again on the next run, which will fail again.

This adds a fallback to regular non-keyframe-only extraction for failed runs, so the extraction can complete.

I implemented it in MediaEncoder.ExtractVideoImagesOnIntervalAccelerated analogously to MediaEncoder.ExtractImage, which already has a similar fallback:

982e0c9370/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs (L630-L644)

MediaEncoder.ExtractVideoImagesOnIntervalAccelerated is called by TrickplayManager.RefreshTrickplayDataInternal, so alternatively is could also be implemented there:

982e0c9370/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs (L323-L338)

I don't have a strong opinion on this. On one hand, ExtractVideoImagesOnIntervalAccelerated is passed enableKeyFrameOnlyExtraction as a parameter, so it should adhere to this and not do any fallbacks by itself, which may be unexpected. On the other hand, it's nice to have this fallback here so it doesn't need to be implemented in several places, in case any other function in the future also decides to call this.


🔄 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/14467 **Author:** [@jkhsjdhjs](https://github.com/jkhsjdhjs) **Created:** 7/14/2025 **Status:** ✅ Merged **Merged:** 8/1/2025 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `keyframe-only-trickplay-extraction-fallback` --- ### 📝 Commits (2) - [`bf3f37e`](https://github.com/jellyfin/jellyfin/commit/bf3f37e3d0d10d77a99dfb38c868de26b3b4a05d) Add fallback for keyframe-only trickplay extraction - [`d6f9375`](https://github.com/jellyfin/jellyfin/commit/d6f93759ead5f58509c6c4ec5fce5a51339b43c5) Add myself to CONTRIBUTORS.md ### 📊 Changes **2 files changed** (+24 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTORS.md` (+1 -0) 📝 `MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs` (+23 -7) </details> ### 📄 Description Keyframe-only trickplay image extraction can fail for some media files. The current behavior is to skip the media file and try again on the next run, which will fail again. This adds a fallback to regular non-keyframe-only extraction for failed runs, so the extraction can complete. I implemented it in `MediaEncoder.ExtractVideoImagesOnIntervalAccelerated` analogously to `MediaEncoder.ExtractImage`, which already has a similar fallback: https://github.com/jellyfin/jellyfin/blob/982e0c9370da3d940799c9292423edeca71b7b71/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs#L630-L644 `MediaEncoder.ExtractVideoImagesOnIntervalAccelerated` is called by `TrickplayManager.RefreshTrickplayDataInternal`, so alternatively is could also be implemented there: https://github.com/jellyfin/jellyfin/blob/982e0c9370da3d940799c9292423edeca71b7b71/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs#L323-L338 I don't have a strong opinion on this. On one hand, `ExtractVideoImagesOnIntervalAccelerated` is passed `enableKeyFrameOnlyExtraction` as a parameter, so it should adhere to this and not do any fallbacks by itself, which may be unexpected. On the other hand, it's nice to have this fallback here so it doesn't need to be implemented in several places, in case any other function in the future also decides to call this. --- <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:22:38 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#13999