mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Fix stream map when using filter_complex with unlabeled output
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
parent
22a8283a9e
commit
d1c668e230
@ -1844,7 +1844,11 @@ namespace Jellyfin.Api.Controllers
|
|||||||
// args += " -mixed-refs 0 -refs 3 -x264opts b_pyramid=0:weightb=0:weightp=0";
|
// args += " -mixed-refs 0 -refs 3 -x264opts b_pyramid=0:weightb=0:weightp=0";
|
||||||
|
|
||||||
// video processing filters.
|
// video processing filters.
|
||||||
args += _encodingHelper.GetVideoProcessingFilterParam(state, _encodingOptions, codec);
|
var videoProcessParam = _encodingHelper.GetVideoProcessingFilterParam(state, _encodingOptions, codec);
|
||||||
|
|
||||||
|
var negativeMapArgs = _encodingHelper.GetNegativeMapArgsByFilters(state, videoProcessParam);
|
||||||
|
|
||||||
|
args = negativeMapArgs + args + videoProcessParam;
|
||||||
|
|
||||||
// -start_at_zero is necessary to use with -ss when seeking,
|
// -start_at_zero is necessary to use with -ss when seeking,
|
||||||
// otherwise the target position cannot be determined.
|
// otherwise the target position cannot be determined.
|
||||||
|
@ -2397,6 +2397,30 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
return args;
|
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>
|
/// <summary>
|
||||||
/// Determines which stream will be used for playback.
|
/// Determines which stream will be used for playback.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -5428,7 +5452,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
// video processing filters.
|
// video processing filters.
|
||||||
var videoProcessParam = GetVideoProcessingFilterParam(state, encodingOptions, videoCodec);
|
var videoProcessParam = GetVideoProcessingFilterParam(state, encodingOptions, videoCodec);
|
||||||
|
|
||||||
args += videoProcessParam;
|
var negativeMapArgs = GetNegativeMapArgsByFilters(state, videoProcessParam);
|
||||||
|
|
||||||
|
args = negativeMapArgs + args + videoProcessParam;
|
||||||
|
|
||||||
hasCopyTs = videoProcessParam.Contains("copyts", StringComparison.OrdinalIgnoreCase);
|
hasCopyTs = videoProcessParam.Contains("copyts", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user