omit qsv decoder when stream copying

pull/702/head
Luke Pulverenti 9 years ago
parent 5d28c65783
commit 19c7c26dad

@ -821,9 +821,14 @@ namespace MediaBrowser.Api.Playback
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
protected string GetVideoDecoder(StreamState state) protected string GetVideoDecoder(StreamState state)
{ {
if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase)) if (string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
{
return null;
}
if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec))
{ {
if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec)) if (string.Equals(ApiEntryPoint.Instance.GetEncodingOptions().HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
{ {
switch (state.MediaSource.VideoStream.Codec.ToLower()) switch (state.MediaSource.VideoStream.Codec.ToLower())
{ {
@ -831,7 +836,8 @@ namespace MediaBrowser.Api.Playback
case "h264": case "h264":
if (MediaEncoder.SupportsDecoder("h264_qsv")) if (MediaEncoder.SupportsDecoder("h264_qsv"))
{ {
return "-c:v h264_qsv "; // Seeing stalls and failures with decoding. Not worth it compared to encoding.
//return "-c:v h264_qsv ";
} }
break; break;
case "mpeg2video": case "mpeg2video":

@ -366,9 +366,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
protected string GetVideoDecoder(EncodingJob state) protected string GetVideoDecoder(EncodingJob state)
{ {
if (string.Equals(GetEncodingOptions().HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase)) if (string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
{ {
if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec)) return null;
}
if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec))
{
if (string.Equals(GetEncodingOptions().HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
{ {
switch (state.MediaSource.VideoStream.Codec.ToLower()) switch (state.MediaSource.VideoStream.Codec.ToLower())
{ {
@ -376,7 +381,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
case "h264": case "h264":
if (MediaEncoder.SupportsDecoder("h264_qsv")) if (MediaEncoder.SupportsDecoder("h264_qsv"))
{ {
return "-c:v h264_qsv "; // Seeing stalls and failures with decoding. Not worth it compared to encoding.
//return "-c:v h264_qsv ";
} }
break; break;
case "mpeg2video": case "mpeg2video":

Loading…
Cancel
Save