|
|
|
@ -158,6 +158,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
/// <param name="maxHeight">Optional. The max height.</param>
|
|
|
|
|
/// <param name="enableSubtitlesInManifest">Optional. Whether to enable subtitles in the manifest.</param>
|
|
|
|
|
/// <param name="enableAudioVbrEncoding">Optional. Whether to enable Audio Encoding.</param>
|
|
|
|
|
/// <param name="alwaysBurnInSubtitleWhenTranscoding">Whether to always burn in subtitles when transcoding.</param>
|
|
|
|
|
/// <response code="200">Hls live stream retrieved.</response>
|
|
|
|
|
/// <returns>A <see cref="FileResult"/> containing the hls file.</returns>
|
|
|
|
|
[HttpGet("Videos/{itemId}/live.m3u8")]
|
|
|
|
@ -216,7 +217,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
[FromQuery] int? maxWidth,
|
|
|
|
|
[FromQuery] int? maxHeight,
|
|
|
|
|
[FromQuery] bool? enableSubtitlesInManifest,
|
|
|
|
|
[FromQuery] bool enableAudioVbrEncoding = true)
|
|
|
|
|
[FromQuery] bool enableAudioVbrEncoding = true,
|
|
|
|
|
[FromQuery] bool alwaysBurnInSubtitleWhenTranscoding = false)
|
|
|
|
|
{
|
|
|
|
|
VideoRequestDto streamingRequest = new VideoRequestDto
|
|
|
|
|
{
|
|
|
|
@ -251,7 +253,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
Height = height,
|
|
|
|
|
VideoBitRate = videoBitRate,
|
|
|
|
|
SubtitleStreamIndex = subtitleStreamIndex,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.External,
|
|
|
|
|
MaxRefFrames = maxRefFrames,
|
|
|
|
|
MaxVideoBitDepth = maxVideoBitDepth,
|
|
|
|
|
RequireAvc = requireAvc ?? false,
|
|
|
|
@ -271,7 +273,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
MaxHeight = maxHeight,
|
|
|
|
|
MaxWidth = maxWidth,
|
|
|
|
|
EnableSubtitlesInManifest = enableSubtitlesInManifest ?? true,
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding,
|
|
|
|
|
AlwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// CTS lifecycle is managed internally.
|
|
|
|
@ -398,6 +401,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
/// <param name="enableAdaptiveBitrateStreaming">Enable adaptive bitrate streaming.</param>
|
|
|
|
|
/// <param name="enableTrickplay">Enable trickplay image playlists being added to master playlist.</param>
|
|
|
|
|
/// <param name="enableAudioVbrEncoding">Whether to enable Audio Encoding.</param>
|
|
|
|
|
/// <param name="alwaysBurnInSubtitleWhenTranscoding">Whether to always burn in subtitles when transcoding.</param>
|
|
|
|
|
/// <response code="200">Video stream returned.</response>
|
|
|
|
|
/// <returns>A <see cref="FileResult"/> containing the playlist file.</returns>
|
|
|
|
|
[HttpGet("Videos/{itemId}/master.m3u8")]
|
|
|
|
@ -457,7 +461,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
[FromQuery] Dictionary<string, string> streamOptions,
|
|
|
|
|
[FromQuery] bool enableAdaptiveBitrateStreaming = true,
|
|
|
|
|
[FromQuery] bool enableTrickplay = true,
|
|
|
|
|
[FromQuery] bool enableAudioVbrEncoding = true)
|
|
|
|
|
[FromQuery] bool enableAudioVbrEncoding = true,
|
|
|
|
|
[FromQuery] bool alwaysBurnInSubtitleWhenTranscoding = false)
|
|
|
|
|
{
|
|
|
|
|
var streamingRequest = new HlsVideoRequestDto
|
|
|
|
|
{
|
|
|
|
@ -493,7 +498,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
MaxHeight = maxHeight,
|
|
|
|
|
VideoBitRate = videoBitRate,
|
|
|
|
|
SubtitleStreamIndex = subtitleStreamIndex,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.External,
|
|
|
|
|
MaxRefFrames = maxRefFrames,
|
|
|
|
|
MaxVideoBitDepth = maxVideoBitDepth,
|
|
|
|
|
RequireAvc = requireAvc ?? false,
|
|
|
|
@ -512,7 +517,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
StreamOptions = streamOptions,
|
|
|
|
|
EnableAdaptiveBitrateStreaming = enableAdaptiveBitrateStreaming,
|
|
|
|
|
EnableTrickplay = enableTrickplay,
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding,
|
|
|
|
|
AlwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return await _dynamicHlsHelper.GetMasterHlsPlaylist(TranscodingJobType, streamingRequest, enableAdaptiveBitrateStreaming).ConfigureAwait(false);
|
|
|
|
@ -663,7 +669,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
Height = height,
|
|
|
|
|
VideoBitRate = videoBitRate,
|
|
|
|
|
SubtitleStreamIndex = subtitleStreamIndex,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.External,
|
|
|
|
|
MaxRefFrames = maxRefFrames,
|
|
|
|
|
MaxVideoBitDepth = maxVideoBitDepth,
|
|
|
|
|
RequireAvc = requireAvc ?? false,
|
|
|
|
@ -681,7 +687,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
Context = context ?? EncodingContext.Streaming,
|
|
|
|
|
StreamOptions = streamOptions,
|
|
|
|
|
EnableAdaptiveBitrateStreaming = enableAdaptiveBitrateStreaming,
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding,
|
|
|
|
|
AlwaysBurnInSubtitleWhenTranscoding = false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return await _dynamicHlsHelper.GetMasterHlsPlaylist(TranscodingJobType, streamingRequest, enableAdaptiveBitrateStreaming).ConfigureAwait(false);
|
|
|
|
@ -741,6 +748,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
/// <param name="context">Optional. The <see cref="EncodingContext"/>.</param>
|
|
|
|
|
/// <param name="streamOptions">Optional. The streaming options.</param>
|
|
|
|
|
/// <param name="enableAudioVbrEncoding">Optional. Whether to enable Audio Encoding.</param>
|
|
|
|
|
/// <param name="alwaysBurnInSubtitleWhenTranscoding">Whether to always burn in subtitles when transcoding.</param>
|
|
|
|
|
/// <response code="200">Video stream returned.</response>
|
|
|
|
|
/// <returns>A <see cref="FileResult"/> containing the audio file.</returns>
|
|
|
|
|
[HttpGet("Videos/{itemId}/main.m3u8")]
|
|
|
|
@ -797,7 +805,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
[FromQuery] int? videoStreamIndex,
|
|
|
|
|
[FromQuery] EncodingContext? context,
|
|
|
|
|
[FromQuery] Dictionary<string, string> streamOptions,
|
|
|
|
|
[FromQuery] bool enableAudioVbrEncoding = true)
|
|
|
|
|
[FromQuery] bool enableAudioVbrEncoding = true,
|
|
|
|
|
[FromQuery] bool alwaysBurnInSubtitleWhenTranscoding = false)
|
|
|
|
|
{
|
|
|
|
|
using var cancellationTokenSource = new CancellationTokenSource();
|
|
|
|
|
var streamingRequest = new VideoRequestDto
|
|
|
|
@ -834,7 +843,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
MaxHeight = maxHeight,
|
|
|
|
|
VideoBitRate = videoBitRate,
|
|
|
|
|
SubtitleStreamIndex = subtitleStreamIndex,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.External,
|
|
|
|
|
MaxRefFrames = maxRefFrames,
|
|
|
|
|
MaxVideoBitDepth = maxVideoBitDepth,
|
|
|
|
|
RequireAvc = requireAvc ?? false,
|
|
|
|
@ -851,7 +860,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
VideoStreamIndex = videoStreamIndex,
|
|
|
|
|
Context = context ?? EncodingContext.Streaming,
|
|
|
|
|
StreamOptions = streamOptions,
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding,
|
|
|
|
|
AlwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return await GetVariantPlaylistInternal(streamingRequest, cancellationTokenSource)
|
|
|
|
@ -1001,7 +1011,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
Height = height,
|
|
|
|
|
VideoBitRate = videoBitRate,
|
|
|
|
|
SubtitleStreamIndex = subtitleStreamIndex,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.External,
|
|
|
|
|
MaxRefFrames = maxRefFrames,
|
|
|
|
|
MaxVideoBitDepth = maxVideoBitDepth,
|
|
|
|
|
RequireAvc = requireAvc ?? false,
|
|
|
|
@ -1018,7 +1028,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
VideoStreamIndex = videoStreamIndex,
|
|
|
|
|
Context = context ?? EncodingContext.Streaming,
|
|
|
|
|
StreamOptions = streamOptions,
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding,
|
|
|
|
|
AlwaysBurnInSubtitleWhenTranscoding = false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return await GetVariantPlaylistInternal(streamingRequest, cancellationTokenSource)
|
|
|
|
@ -1084,6 +1095,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
/// <param name="context">Optional. The <see cref="EncodingContext"/>.</param>
|
|
|
|
|
/// <param name="streamOptions">Optional. The streaming options.</param>
|
|
|
|
|
/// <param name="enableAudioVbrEncoding">Optional. Whether to enable Audio Encoding.</param>
|
|
|
|
|
/// <param name="alwaysBurnInSubtitleWhenTranscoding">Whether to always burn in subtitles when transcoding.</param>
|
|
|
|
|
/// <response code="200">Video stream returned.</response>
|
|
|
|
|
/// <returns>A <see cref="FileResult"/> containing the audio file.</returns>
|
|
|
|
|
[HttpGet("Videos/{itemId}/hls1/{playlistId}/{segmentId}.{container}")]
|
|
|
|
@ -1146,7 +1158,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
[FromQuery] int? videoStreamIndex,
|
|
|
|
|
[FromQuery] EncodingContext? context,
|
|
|
|
|
[FromQuery] Dictionary<string, string> streamOptions,
|
|
|
|
|
[FromQuery] bool enableAudioVbrEncoding = true)
|
|
|
|
|
[FromQuery] bool enableAudioVbrEncoding = true,
|
|
|
|
|
[FromQuery] bool alwaysBurnInSubtitleWhenTranscoding = false)
|
|
|
|
|
{
|
|
|
|
|
var streamingRequest = new VideoRequestDto
|
|
|
|
|
{
|
|
|
|
@ -1185,7 +1198,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
MaxHeight = maxHeight,
|
|
|
|
|
VideoBitRate = videoBitRate,
|
|
|
|
|
SubtitleStreamIndex = subtitleStreamIndex,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.External,
|
|
|
|
|
MaxRefFrames = maxRefFrames,
|
|
|
|
|
MaxVideoBitDepth = maxVideoBitDepth,
|
|
|
|
|
RequireAvc = requireAvc ?? false,
|
|
|
|
@ -1202,7 +1215,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
VideoStreamIndex = videoStreamIndex,
|
|
|
|
|
Context = context ?? EncodingContext.Streaming,
|
|
|
|
|
StreamOptions = streamOptions,
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding,
|
|
|
|
|
AlwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return await GetDynamicSegment(streamingRequest, segmentId)
|
|
|
|
@ -1365,7 +1379,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
Height = height,
|
|
|
|
|
VideoBitRate = videoBitRate,
|
|
|
|
|
SubtitleStreamIndex = subtitleStreamIndex,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
|
|
|
|
|
SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.External,
|
|
|
|
|
MaxRefFrames = maxRefFrames,
|
|
|
|
|
MaxVideoBitDepth = maxVideoBitDepth,
|
|
|
|
|
RequireAvc = requireAvc ?? false,
|
|
|
|
@ -1382,7 +1396,8 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|
|
|
|
VideoStreamIndex = videoStreamIndex,
|
|
|
|
|
Context = context ?? EncodingContext.Streaming,
|
|
|
|
|
StreamOptions = streamOptions,
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding
|
|
|
|
|
EnableAudioVbrEncoding = enableAudioVbrEncoding,
|
|
|
|
|
AlwaysBurnInSubtitleWhenTranscoding = false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return await GetDynamicSegment(streamingRequest, segmentId)
|
|
|
|
|