fix text sub burn in with hls

pull/702/head
Luke Pulverenti 10 years ago
parent a4e73120a7
commit 9f0d01d9dd

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

Loading…
Cancel
Save