mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-09-09 08:05:11 +00:00
Add TranscodingSegmentCleaner to replace ffmpeg's hlsenc deletion
FFmpeg deletes segments based on its own transcoding progress, but we need to delete segments based on client download progress. Since disk and GPU speeds vary, using hlsenc's built-in deletion will result in premature deletion of some segments. As a consequence, the server has to constantly respin new ffmpeg instances, resulting in choppy video playback. Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
parent
1e964c9bc2
commit
eca9bf41bc
4 changed files with 214 additions and 28 deletions
|
|
@ -136,6 +136,11 @@ public sealed class TranscodingJob : IDisposable
|
|||
/// </summary>
|
||||
public TranscodingThrottler? TranscodingThrottler { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets transcoding segment cleaner.
|
||||
/// </summary>
|
||||
public TranscodingSegmentCleaner? TranscodingSegmentCleaner { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets last ping date.
|
||||
/// </summary>
|
||||
|
|
@ -239,6 +244,7 @@ public sealed class TranscodingJob : IDisposable
|
|||
{
|
||||
#pragma warning disable CA1849 // Can't await in lock block
|
||||
TranscodingThrottler?.Stop().GetAwaiter().GetResult();
|
||||
TranscodingSegmentCleaner?.Stop();
|
||||
|
||||
var process = Process;
|
||||
|
||||
|
|
@ -276,5 +282,7 @@ public sealed class TranscodingJob : IDisposable
|
|||
CancellationTokenSource = null;
|
||||
TranscodingThrottler?.Dispose();
|
||||
TranscodingThrottler = null;
|
||||
TranscodingSegmentCleaner?.Dispose();
|
||||
TranscodingSegmentCleaner = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue