mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 06:53:07 +03:00
support track selection before playback
This commit is contained in:
@@ -1325,6 +1325,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
if (state.VideoStream != null && state.VideoStream.Width.HasValue && state.VideoStream.Height.HasValue)
|
||||
{
|
||||
videoSizeParam = string.Format("scale={0}:{1}", state.VideoStream.Width.Value.ToString(_usCulture), state.VideoStream.Height.Value.ToString(_usCulture));
|
||||
|
||||
videoSizeParam += ":force_original_aspect_ratio=decrease";
|
||||
}
|
||||
|
||||
var mapPrefix = state.SubtitleStream.IsExternal ?
|
||||
@@ -1335,7 +1337,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
? 0
|
||||
: state.SubtitleStream.Index;
|
||||
|
||||
return string.Format(" -filter_complex \"[{0}:{1}]{4}[sub] ; [0:{2}] [sub] overlay{3}\"",
|
||||
return string.Format(" -filter_complex \"[{0}:{1}]{4}[sub];[0:{2}][sub]overlay{3}\"",
|
||||
mapPrefix.ToString(_usCulture),
|
||||
subtitleStreamIndex.ToString(_usCulture),
|
||||
state.VideoStream.Index.ToString(_usCulture),
|
||||
@@ -2094,6 +2096,12 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
args += " -avoid_negative_ts disabled -start_at_zero";
|
||||
}
|
||||
|
||||
// This is for internal graphical subs
|
||||
if (hasGraphicalSubs)
|
||||
{
|
||||
args += GetGraphicalSubtitleParam(state, encodingOptions, videoCodec);
|
||||
}
|
||||
|
||||
var qualityParam = GetVideoQualityParam(state, videoCodec, encodingOptions, defaultH264Preset);
|
||||
|
||||
if (!string.IsNullOrEmpty(qualityParam))
|
||||
@@ -2101,12 +2109,6 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
args += " " + qualityParam.Trim();
|
||||
}
|
||||
|
||||
// This is for internal graphical subs
|
||||
if (hasGraphicalSubs)
|
||||
{
|
||||
args += GetGraphicalSubtitleParam(state, encodingOptions, videoCodec);
|
||||
}
|
||||
|
||||
if (!state.RunTimeTicks.HasValue)
|
||||
{
|
||||
args += " -flags -global_header";
|
||||
|
||||
Reference in New Issue
Block a user