diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-08-19 16:28:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-19 16:28:43 -0400 |
| commit | 1bce9a89b6fe6b37cddfc13f6c8ed9bf570a76f5 (patch) | |
| tree | 7e3193614c5a132ae63034c2bb7e07956a5670e6 /MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | |
| parent | d99278da1dcac4d3c60739e864597aa01f916636 (diff) | |
| parent | d95c04787cc4486f4ea5caaef20f6ac407a3f84a (diff) | |
Merge pull request #1433 from fhriley/h265
Add support for encoding with libx265 and hevc_nvenc
Diffstat (limited to 'MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index fdae59f56..1f24ae881 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -895,9 +895,13 @@ namespace MediaBrowser.Api.Playback.Hls // See if we can save come cpu cycles by avoiding encoding if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase)) { - if (state.VideoStream != null && EncodingHelper.IsH264(state.VideoStream) && !string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase)) + 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; + } } //args += " -flags -global_header"; @@ -909,7 +913,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; //args += " -mixed-refs 0 -refs 3 -x264opts b_pyramid=0:weightb=0:weightp=0"; |
