fix text sub burn in with hls

This commit is contained in:
Luke Pulverenti 2015-09-01 21:50:02 -04:00
parent a4e73120a7
commit 9f0d01d9dd

View File

@ -869,7 +869,7 @@ namespace MediaBrowser.Api.Playback.Hls
// Add resolution params, if specified
if (!hasGraphicalSubs)
{
args += GetOutputSizeParam(state, codec, false);
args += GetOutputSizeParam(state, codec, EnableCopyTs(state));
}
// This is for internal graphical subs
@ -878,12 +878,17 @@ namespace MediaBrowser.Api.Playback.Hls
args += GetGraphicalSubtitleParam(state, codec);
}
args += " -flags +loop-global_header -sc_threshold 0";
args += " -flags -global_header -sc_threshold 0";
}
return args;
}
private bool EnableCopyTs(StreamState state)
{
return state.SubtitleStream != null && state.SubtitleStream.IsTextSubtitleStream;
}
protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding)
{
var threads = GetNumberOfThreads(state, false);
@ -896,7 +901,7 @@ namespace MediaBrowser.Api.Playback.Hls
var toTimeParam = string.Empty;
var timestampOffsetParam = string.Empty;
if (state.IsOutputVideo && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase) && (state.Request.StartTimeTicks ?? 0) > 0)
if (state.IsOutputVideo && !EnableCopyTs(state) && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase) && (state.Request.StartTimeTicks ?? 0) > 0)
{
timestampOffsetParam = " -output_ts_offset " + MediaEncoder.GetTimeParameter(state.Request.StartTimeTicks ?? 0).ToString(CultureInfo.InvariantCulture);
}