aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-11-23 11:12:06 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-11-23 11:12:06 -0500
commit03cf0d6df0284fc50b7494bc3bd229cd5f22c248 (patch)
tree187989fc93f88177910e2aac87b3463134a2f4d0
parent1ee7826be670434462d1fba6fe82a482b17fbca3 (diff)
update qsv encoding
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs17
-rw-r--r--MediaBrowser.Api/Playback/Dash/MpegDashService.cs2
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs2
-rw-r--r--MediaBrowser.Api/Playback/Hls/VideoHlsService.cs2
4 files changed, 13 insertions, 10 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 5d08f2447..f30e4008d 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -287,17 +287,18 @@ namespace MediaBrowser.Api.Playback
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 "libx264";
}
+
+ return "libx264";
}
/// <summary>
@@ -405,8 +406,10 @@ namespace MediaBrowser.Api.Playback
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
- 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)
{
@@ -790,7 +793,7 @@ namespace MediaBrowser.Api.Playback
{
if (string.Equals(codec, "h264", StringComparison.OrdinalIgnoreCase))
{
- return H264Encoder;
+ return GetH264Encoder(state);
}
if (string.Equals(codec, "vpx", StringComparison.OrdinalIgnoreCase))
{
diff --git a/MediaBrowser.Api/Playback/Dash/MpegDashService.cs b/MediaBrowser.Api/Playback/Dash/MpegDashService.cs
index 49d3db110..9ec16fcc7 100644
--- a/MediaBrowser.Api/Playback/Dash/MpegDashService.cs
+++ b/MediaBrowser.Api/Playback/Dash/MpegDashService.cs
@@ -430,7 +430,7 @@ namespace MediaBrowser.Api.Playback.Dash
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
if (!hasGraphicalSubs)
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 4d7a10f02..a5fa7a0f4 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -871,7 +871,7 @@ namespace MediaBrowser.Api.Playback.Hls
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";
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
index c5392b38f..be1db1a4d 100644
--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
@@ -106,7 +106,7 @@ namespace MediaBrowser.Api.Playback.Hls
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
if (!hasGraphicalSubs)