Fix AV1 playback in LiveTV

AV1 in fMP4 requires global_header data for parsing.
Only disable global_header in TS since it has no global_header.

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
pull/10183/head
nyanmisaka 1 year ago
parent 5491840c2a
commit b2dcc7c90e

@ -1651,7 +1651,7 @@ public class DynamicHlsController : BaseJellyfinApiController
_encodingHelper.GetInputArgument(state, _encodingOptions, segmentContainer), _encodingHelper.GetInputArgument(state, _encodingOptions, segmentContainer),
threads, threads,
mapArgs, mapArgs,
GetVideoArguments(state, startNumber, isEventPlaylist), GetVideoArguments(state, startNumber, isEventPlaylist, segmentContainer),
GetAudioArguments(state), GetAudioArguments(state),
maxMuxingQueueSize, maxMuxingQueueSize,
state.SegmentLength.ToString(CultureInfo.InvariantCulture), state.SegmentLength.ToString(CultureInfo.InvariantCulture),
@ -1814,8 +1814,9 @@ public class DynamicHlsController : BaseJellyfinApiController
/// <param name="state">The <see cref="StreamState"/>.</param> /// <param name="state">The <see cref="StreamState"/>.</param>
/// <param name="startNumber">The first number in the hls sequence.</param> /// <param name="startNumber">The first number in the hls sequence.</param>
/// <param name="isEventPlaylist">Whether the playlist is EVENT or VOD.</param> /// <param name="isEventPlaylist">Whether the playlist is EVENT or VOD.</param>
/// <param name="segmentContainer">The segment container.</param>
/// <returns>The command line arguments for video transcoding.</returns> /// <returns>The command line arguments for video transcoding.</returns>
private string GetVideoArguments(StreamState state, int startNumber, bool isEventPlaylist) private string GetVideoArguments(StreamState state, int startNumber, bool isEventPlaylist, string segmentContainer)
{ {
if (state.VideoStream is null) if (state.VideoStream is null)
{ {
@ -1907,7 +1908,7 @@ public class DynamicHlsController : BaseJellyfinApiController
} }
// TODO why was this not enabled for VOD? // TODO why was this not enabled for VOD?
if (isEventPlaylist) if (isEventPlaylist && string.Equals(segmentContainer, "ts", StringComparison.OrdinalIgnoreCase))
{ {
args += " -flags -global_header"; args += " -flags -global_header";
} }

Loading…
Cancel
Save