aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-08-19 16:28:43 -0400
committerGitHub <noreply@github.com>2019-08-19 16:28:43 -0400
commit1bce9a89b6fe6b37cddfc13f6c8ed9bf570a76f5 (patch)
tree7e3193614c5a132ae63034c2bb7e07956a5670e6 /MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
parentd99278da1dcac4d3c60739e864597aa01f916636 (diff)
parentd95c04787cc4486f4ea5caaef20f6ac407a3f84a (diff)
Merge pull request #1433 from fhriley/h265
Add support for encoding with libx265 and hevc_nvenc
Diffstat (limited to 'MediaBrowser.Api/Playback/Hls/VideoHlsService.cs')
-rw-r--r--MediaBrowser.Api/Playback/Hls/VideoHlsService.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
index 3c715c5ad..4a5f4025b 100644
--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
@@ -92,10 +92,14 @@ namespace MediaBrowser.Api.Playback.Hls
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
{
// if h264_mp4toannexb is ever added, do not use it for live tv
- if (state.VideoStream != null && EncodingHelper.IsH264(state.VideoStream) &&
+ if (state.VideoStream != null &&
!string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
{
- args += " -bsf:v h264_mp4toannexb";
+ string bitStreamArgs = EncodingHelper.GetBitStreamArgs(state.VideoStream);
+ if (!string.IsNullOrEmpty(bitStreamArgs))
+ {
+ args += " " + bitStreamArgs;
+ }
}
}
else
@@ -105,7 +109,7 @@ namespace MediaBrowser.Api.Playback.Hls
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
- args += " " + EncodingHelper.GetVideoQualityParam(state, codec, encodingOptions, GetDefaultH264Preset()) + keyFrameArg;
+ args += " " + EncodingHelper.GetVideoQualityParam(state, codec, encodingOptions, GetDefaultEncoderPreset()) + keyFrameArg;
// Add resolution params, if specified
if (!hasGraphicalSubs)