mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
update qsv encoding
This commit is contained in:
parent
1ee7826be6
commit
03cf0d6df0
@ -287,18 +287,19 @@ namespace MediaBrowser.Api.Playback
|
|||||||
return threads;
|
return threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string H264Encoder
|
protected string GetH264Encoder(StreamState state)
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
{
|
||||||
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareVideoDecoder, "qsv", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareVideoDecoder, "qsv", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
// It's currently failing on live tv
|
||||||
|
if (state.RunTimeTicks.HasValue)
|
||||||
{
|
{
|
||||||
return "h264_qsv";
|
return "h264_qsv";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return "libx264";
|
return "libx264";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the video bitrate to specify on the command line
|
/// Gets the video bitrate to specify on the command line
|
||||||
@ -405,8 +406,10 @@ namespace MediaBrowser.Api.Playback
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(state.VideoRequest.Level))
|
if (!string.IsNullOrEmpty(state.VideoRequest.Level))
|
||||||
{
|
{
|
||||||
|
var h264Encoder = GetH264Encoder(state);
|
||||||
|
|
||||||
// h264_qsv and libnvenc expect levels to be expressed as a decimal. libx264 supports decimal and non-decimal format
|
// h264_qsv and libnvenc expect levels to be expressed as a decimal. libx264 supports decimal and non-decimal format
|
||||||
if (String.Equals(H264Encoder, "h264_qsv", StringComparison.OrdinalIgnoreCase) || String.Equals(H264Encoder, "libnvenc", StringComparison.OrdinalIgnoreCase))
|
if (String.Equals(h264Encoder, "h264_qsv", StringComparison.OrdinalIgnoreCase) || String.Equals(h264Encoder, "libnvenc", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
switch (state.VideoRequest.Level)
|
switch (state.VideoRequest.Level)
|
||||||
{
|
{
|
||||||
@ -790,7 +793,7 @@ namespace MediaBrowser.Api.Playback
|
|||||||
{
|
{
|
||||||
if (string.Equals(codec, "h264", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(codec, "h264", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return H264Encoder;
|
return GetH264Encoder(state);
|
||||||
}
|
}
|
||||||
if (string.Equals(codec, "vpx", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(codec, "vpx", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -430,7 +430,7 @@ namespace MediaBrowser.Api.Playback.Dash
|
|||||||
|
|
||||||
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream;
|
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream;
|
||||||
|
|
||||||
args += " " + GetVideoQualityParam(state, H264Encoder, true) + keyFrameArg;
|
args += " " + GetVideoQualityParam(state, GetH264Encoder(state), true) + keyFrameArg;
|
||||||
|
|
||||||
// Add resolution params, if specified
|
// Add resolution params, if specified
|
||||||
if (!hasGraphicalSubs)
|
if (!hasGraphicalSubs)
|
||||||
|
@ -871,7 +871,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||||||
|
|
||||||
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream;
|
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream;
|
||||||
|
|
||||||
args += " " + GetVideoQualityParam(state, H264Encoder, true) + keyFrameArg;
|
args += " " + GetVideoQualityParam(state, GetH264Encoder(state), true) + keyFrameArg;
|
||||||
|
|
||||||
//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";
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||||||
|
|
||||||
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream;
|
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream;
|
||||||
|
|
||||||
args += " " + GetVideoQualityParam(state, H264Encoder, true) + keyFrameArg;
|
args += " " + GetVideoQualityParam(state, GetH264Encoder(state), true) + keyFrameArg;
|
||||||
|
|
||||||
// Add resolution params, if specified
|
// Add resolution params, if specified
|
||||||
if (!hasGraphicalSubs)
|
if (!hasGraphicalSubs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user