record nal length size

This commit is contained in:
Luke Pulverenti
2016-04-17 23:50:44 -04:00
parent 565b3350a1
commit 2b4dece54a
8 changed files with 57 additions and 9 deletions

View File

@@ -828,8 +828,9 @@ namespace MediaBrowser.Api.Playback.Hls
// See if we can save come cpu cycles by avoiding encoding
if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase))
{
if (state.VideoStream != null && IsH264(state.VideoStream))
if (state.VideoStream != null && IsH264(state.VideoStream) && !string.IsNullOrWhiteSpace(state.VideoStream.NalLengthSize))
{
Logger.Debug("Enabling h264_mp4toannexb due to nal_length_size of {0}", state.VideoStream.NalLengthSize);
args += " -bsf:v h264_mp4toannexb";
}

View File

@@ -87,6 +87,11 @@ namespace MediaBrowser.Api.Playback.Hls
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
{
// if h264_mp4toannexb is ever added, do not use it for live tv
if (state.VideoStream != null && IsH264(state.VideoStream) && !string.IsNullOrWhiteSpace(state.VideoStream.NalLengthSize))
{
Logger.Debug("Enabling h264_mp4toannexb due to nal_length_size of {0}", state.VideoStream.NalLengthSize);
args += " -bsf:v h264_mp4toannexb";
}
return args;
}

View File

@@ -139,9 +139,9 @@ namespace MediaBrowser.Api.Playback.Progressive
if (string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase))
{
if (state.VideoStream != null && IsH264(state.VideoStream) &&
(string.Equals(state.OutputContainer, "ts", StringComparison.OrdinalIgnoreCase)))
if (state.VideoStream != null && IsH264(state.VideoStream) && string.Equals(state.OutputContainer, "ts", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(state.VideoStream.NalLengthSize))
{
Logger.Debug("Enabling h264_mp4toannexb due to nal_length_size of {0}", state.VideoStream.NalLengthSize);
args += " -bsf:v h264_mp4toannexb";
}