mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-31 20:24:21 -04:00
Clean up deprecated -vsync option (#12765)
This commit is contained in:
parent
9604088e3c
commit
b496f979f0
@ -1908,7 +1908,7 @@ public class DynamicHlsController : BaseJellyfinApiController
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(state.OutputVideoSync))
|
if (!string.IsNullOrEmpty(state.OutputVideoSync))
|
||||||
{
|
{
|
||||||
args += " -vsync " + state.OutputVideoSync;
|
args += EncodingHelper.GetVideoSyncOption(state.OutputVideoSync, _mediaEncoder.EncoderVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
args += _encodingHelper.GetOutputFFlags(state);
|
args += _encodingHelper.GetOutputFFlags(state);
|
||||||
|
@ -6857,7 +6857,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(state.InputVideoSync))
|
if (!string.IsNullOrEmpty(state.InputVideoSync))
|
||||||
{
|
{
|
||||||
inputModifier += " -vsync " + state.InputVideoSync;
|
inputModifier += GetVideoSyncOption(state.InputVideoSync, _mediaEncoder.EncoderVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.ReadInputAtNativeFramerate && state.InputProtocol != MediaProtocol.Rtsp)
|
if (state.ReadInputAtNativeFramerate && state.InputProtocol != MediaProtocol.Rtsp)
|
||||||
@ -7280,7 +7280,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(state.OutputVideoSync))
|
if (!string.IsNullOrEmpty(state.OutputVideoSync))
|
||||||
{
|
{
|
||||||
args += " -vsync " + state.OutputVideoSync;
|
args += GetVideoSyncOption(state.OutputVideoSync, _mediaEncoder.EncoderVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
args += GetOutputFFlags(state);
|
args += GetOutputFFlags(state);
|
||||||
@ -7453,5 +7453,33 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
return state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode
|
return state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode
|
||||||
|| (state.BaseRequest.AlwaysBurnInSubtitleWhenTranscoding && !IsCopyCodec(state.OutputVideoCodec));
|
|| (state.BaseRequest.AlwaysBurnInSubtitleWhenTranscoding && !IsCopyCodec(state.OutputVideoCodec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetVideoSyncOption(string videoSync, Version encoderVersion)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(videoSync))
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (encoderVersion >= new Version(5, 1))
|
||||||
|
{
|
||||||
|
if (int.TryParse(videoSync, CultureInfo.InvariantCulture, out var vsync))
|
||||||
|
{
|
||||||
|
return vsync switch
|
||||||
|
{
|
||||||
|
-1 => " -fps_mode auto",
|
||||||
|
0 => " -fps_mode passthrough",
|
||||||
|
1 => " -fps_mode cfr",
|
||||||
|
2 => " -fps_mode vfr",
|
||||||
|
_ => string.Empty
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -vsync is deprecated in FFmpeg 5.1 and will be removed in the future.
|
||||||
|
return $" -vsync {videoSync}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -945,7 +945,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
vidEncoder,
|
vidEncoder,
|
||||||
encoderQualityOption + encoderQuality + " ",
|
encoderQualityOption + encoderQuality + " ",
|
||||||
vidEncoder.Contains("videotoolbox", StringComparison.InvariantCultureIgnoreCase) ? "-allow_sw 1 " : string.Empty, // allow_sw fallback for some intel macs
|
vidEncoder.Contains("videotoolbox", StringComparison.InvariantCultureIgnoreCase) ? "-allow_sw 1 " : string.Empty, // allow_sw fallback for some intel macs
|
||||||
EncoderVersion >= new Version(5, 1) ? "-fps_mode passthrough " : "-vsync passthrough ", // passthrough timestamp
|
EncodingHelper.GetVideoSyncOption("0", EncoderVersion).Trim() + " ", // passthrough timestamp
|
||||||
"image2",
|
"image2",
|
||||||
outputPath);
|
outputPath);
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ namespace Jellyfin.LiveTv.IO
|
|||||||
const int MaxBitrate = 25000000;
|
const int MaxBitrate = 25000000;
|
||||||
videoArgs = string.Format(
|
videoArgs = string.Format(
|
||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
"-codec:v:0 libx264 -force_key_frames \"expr:gte(t,n_forced*5)\" {0} -pix_fmt yuv420p -preset superfast -crf 23 -b:v {1} -maxrate {1} -bufsize ({1}*2) -vsync -1 -profile:v high -level 41",
|
"-codec:v:0 libx264 -force_key_frames \"expr:gte(t,n_forced*5)\" {0} -pix_fmt yuv420p -preset superfast -crf 23 -b:v {1} -maxrate {1} -bufsize ({1}*2) -profile:v high -level 41",
|
||||||
GetOutputSizeParam(),
|
GetOutputSizeParam(),
|
||||||
MaxBitrate);
|
MaxBitrate);
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ namespace Jellyfin.LiveTv.IO
|
|||||||
flags.Add("+genpts");
|
flags.Add("+genpts");
|
||||||
}
|
}
|
||||||
|
|
||||||
var inputModifier = "-async 1 -vsync -1";
|
var inputModifier = "-async 1";
|
||||||
|
|
||||||
if (flags.Count > 0)
|
if (flags.Count > 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user