|
@@ -2397,6 +2397,30 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|
|
return args;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Gets the negative map args by filters.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="state">The state.</param>
|
|
|
+ /// <param name="videoProcessFilters">The videoProcessFilters.</param>
|
|
|
+ /// <returns>System.String.</returns>
|
|
|
+ public string GetNegativeMapArgsByFilters(EncodingJobInfo state, string videoProcessFilters)
|
|
|
+ {
|
|
|
+ string args = string.Empty;
|
|
|
+
|
|
|
+ // http://ffmpeg.org/ffmpeg-all.html#toc-Complex-filtergraphs-1
|
|
|
+ if (state.VideoStream != null && videoProcessFilters.Contains("-filter_complex", StringComparison.Ordinal))
|
|
|
+ {
|
|
|
+ int videoStreamIndex = FindIndex(state.MediaSource.MediaStreams, state.VideoStream);
|
|
|
+
|
|
|
+ args += string.Format(
|
|
|
+ CultureInfo.InvariantCulture,
|
|
|
+ "-map -0:{0} ",
|
|
|
+ videoStreamIndex);
|
|
|
+ }
|
|
|
+
|
|
|
+ return args;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Determines which stream will be used for playback.
|
|
|
/// </summary>
|
|
@@ -5428,7 +5452,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|
|
// video processing filters.
|
|
|
var videoProcessParam = GetVideoProcessingFilterParam(state, encodingOptions, videoCodec);
|
|
|
|
|
|
- args += videoProcessParam;
|
|
|
+ var negativeMapArgs = GetNegativeMapArgsByFilters(state, videoProcessParam);
|
|
|
+
|
|
|
+ args = negativeMapArgs + args + videoProcessParam;
|
|
|
|
|
|
hasCopyTs = videoProcessParam.Contains("copyts", StringComparison.OrdinalIgnoreCase);
|
|
|
|