[PR #14565] Improve RecordFromMediaSource resilience. #13855

Open
opened 2025-12-22 10:06:26 +01:00 by backuprepo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/14565
Author: @FerronN
Created: 8/2/2025
Status: 🔄 Open

Base: release-10.10.zHead: ft-dvr-resilience


📝 Commits (2)

  • 84115e8 Improve RecordFromMediaSource resilience.
  • ae679b5 Fix ABI compliance for StreamHelper.cs

📊 Changes

3 files changed (+81 additions, -23 deletions)

View changed files

📝 MediaBrowser.Model/IO/IODefaults.cs (+5 -0)
📝 src/Jellyfin.LiveTv/IO/DirectRecorder.cs (+46 -19)
📝 src/Jellyfin.LiveTv/IO/StreamHelper.cs (+30 -4)

📄 Description

Hi,

I recently added LiveTV functionality to my Jellyfin installation. When recording programs, I noticed that my recordings were much shorter then then they should be. For example, if I the recording should be 1,5 hours, it only recorded 1 to 30 minutes, but I couldn't find any errors. Probably because the streams I watch aren't as stable as you want to be. Although you don't notice this when watching live (buffering in the Android TV client).

I noticed that the current code doesn't have any error handling if the stream for whatever reasons stops before the durationToken cancellation is requested. So, I updated the code to handle this. For me this works perfectly now.

I think the recording should always try to reconnect as long as the linkedCancellationToken cancellation hasn't been requested.

Please let me know if you have feedback on my implementation.

Changes

  • Added retry logic for restarting the stream for method RecordFromMediaSource in EncodedRecorder.cs.
  • Added a bufferstream to smooth out minor hiccups (shows less drops then the retry logic) for CopyToAsyncInternal in StreamHelper.cs.

🔄 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/14565 **Author:** [@FerronN](https://github.com/FerronN) **Created:** 8/2/2025 **Status:** 🔄 Open **Base:** `release-10.10.z` ← **Head:** `ft-dvr-resilience` --- ### 📝 Commits (2) - [`84115e8`](https://github.com/jellyfin/jellyfin/commit/84115e8966d04f1110df32046caa6a042c86c84b) Improve RecordFromMediaSource resilience. - [`ae679b5`](https://github.com/jellyfin/jellyfin/commit/ae679b5e9c1c59f6963f8137c894972fc5199ef0) Fix ABI compliance for StreamHelper.cs ### 📊 Changes **3 files changed** (+81 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `MediaBrowser.Model/IO/IODefaults.cs` (+5 -0) 📝 `src/Jellyfin.LiveTv/IO/DirectRecorder.cs` (+46 -19) 📝 `src/Jellyfin.LiveTv/IO/StreamHelper.cs` (+30 -4) </details> ### 📄 Description Hi, I recently added LiveTV functionality to my Jellyfin installation. When recording programs, I noticed that my recordings were much shorter then then they should be. For example, if I the recording should be 1,5 hours, it only recorded 1 to 30 minutes, but I couldn't find any errors. Probably because the streams I watch aren't as stable as you want to be. Although you don't notice this when watching live (buffering in the Android TV client). I noticed that the current code doesn't have any error handling if the stream for whatever reasons stops before the durationToken cancellation is requested. So, I updated the code to handle this. For me this works perfectly now. I think the recording should always try to reconnect as long as the linkedCancellationToken cancellation hasn't been requested. Please let me know if you have feedback on my implementation. **Changes** - Added retry logic for restarting the stream for method `RecordFromMediaSource` in `EncodedRecorder.cs`. - Added a bufferstream to smooth out minor hiccups (shows less drops then the retry logic) for `CopyToAsyncInternal` in `StreamHelper.cs`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
backuprepo added the
pull-request
label 2025-12-22 10:06:26 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#13855
No description provided.