Merge pull request #10183 from nyanmisaka/fix-av1-livetv

pull/10190/head
Cody Robibero 1 year ago committed by GitHub
commit fe63b7d35a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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";
} }

@ -1216,6 +1216,12 @@ namespace MediaBrowser.Controller.MediaEncoding
int bitrate = state.OutputVideoBitrate.Value; int bitrate = state.OutputVideoBitrate.Value;
// Bit rate under 1000k is not allowed in h264_qsv
if (string.Equals(videoCodec, "h264_qsv", StringComparison.OrdinalIgnoreCase))
{
bitrate = Math.Max(bitrate, 1000);
}
// Currently use the same buffer size for all encoders // Currently use the same buffer size for all encoders
int bufsize = bitrate * 2; int bufsize = bitrate * 2;

Loading…
Cancel
Save