aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Jellyfin.MediaEncoding.Hls/Playlist/CreateMainPlaylistRequest.cs9
-rw-r--r--src/Jellyfin.MediaEncoding.Hls/Playlist/DynamicHlsPlaylistGenerator.cs3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Jellyfin.MediaEncoding.Hls/Playlist/CreateMainPlaylistRequest.cs b/src/Jellyfin.MediaEncoding.Hls/Playlist/CreateMainPlaylistRequest.cs
index ac28ca26a..8572a5eae 100644
--- a/src/Jellyfin.MediaEncoding.Hls/Playlist/CreateMainPlaylistRequest.cs
+++ b/src/Jellyfin.MediaEncoding.Hls/Playlist/CreateMainPlaylistRequest.cs
@@ -14,7 +14,8 @@ public class CreateMainPlaylistRequest
/// <param name="segmentContainer">The desired segment container eg. "ts".</param>
/// <param name="endpointPrefix">The URI prefix for the relative URL in the playlist.</param>
/// <param name="queryString">The desired query string to append (must start with ?).</param>
- public CreateMainPlaylistRequest(string filePath, int desiredSegmentLengthMs, long totalRuntimeTicks, string segmentContainer, string endpointPrefix, string queryString)
+ /// <param name="isRemuxingVideo">Whether the video is being remuxed.</param>
+ public CreateMainPlaylistRequest(string filePath, int desiredSegmentLengthMs, long totalRuntimeTicks, string segmentContainer, string endpointPrefix, string queryString, bool isRemuxingVideo)
{
FilePath = filePath;
DesiredSegmentLengthMs = desiredSegmentLengthMs;
@@ -22,6 +23,7 @@ public class CreateMainPlaylistRequest
SegmentContainer = segmentContainer;
EndpointPrefix = endpointPrefix;
QueryString = queryString;
+ IsRemuxingVideo = isRemuxingVideo;
}
/// <summary>
@@ -53,4 +55,9 @@ public class CreateMainPlaylistRequest
/// Gets the query string.
/// </summary>
public string QueryString { get; }
+
+ /// <summary>
+ /// Gets a value indicating whether the video is being remuxed.
+ /// </summary>
+ public bool IsRemuxingVideo { get; }
}
diff --git a/src/Jellyfin.MediaEncoding.Hls/Playlist/DynamicHlsPlaylistGenerator.cs b/src/Jellyfin.MediaEncoding.Hls/Playlist/DynamicHlsPlaylistGenerator.cs
index 3382ba251..07a6d6050 100644
--- a/src/Jellyfin.MediaEncoding.Hls/Playlist/DynamicHlsPlaylistGenerator.cs
+++ b/src/Jellyfin.MediaEncoding.Hls/Playlist/DynamicHlsPlaylistGenerator.cs
@@ -34,7 +34,8 @@ public class DynamicHlsPlaylistGenerator : IDynamicHlsPlaylistGenerator
public string CreateMainPlaylist(CreateMainPlaylistRequest request)
{
IReadOnlyList<double> segments;
- if (TryExtractKeyframes(request.FilePath, out var keyframeData))
+ // For video transcodes it is sufficient with equal length segments as ffmpeg will create new keyframes
+ if (request.IsRemuxingVideo && TryExtractKeyframes(request.FilePath, out var keyframeData))
{
segments = ComputeSegments(keyframeData, request.DesiredSegmentLengthMs);
}