aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
diff options
context:
space:
mode:
authorJan Friedrich <jft@dev2day.de>2016-09-24 17:34:54 +0200
committerJan Friedrich <jft@dev2day.de>2016-09-24 17:57:03 +0200
commit3d260bd13c3e2ea21dd6ca0209e1c7b0f7cf1ae9 (patch)
tree99fdf839cd755c09c2fa5e8dcc63c4dd9675faa6 /MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
parentfdc2826709495c5313c4a61060fd420d0f8214b8 (diff)
vaapi: copy decoded frames to main memory only when necessary
Diffstat (limited to 'MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs')
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
index 9d8b7fd63..e8121d178 100644
--- a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
@@ -487,7 +487,15 @@ namespace MediaBrowser.MediaEncoding.Encoder
var videoEncoder = EncodingJobFactory.GetVideoEncoder(MediaEncoder, state, encodingOptions);
if (videoEncoder.IndexOf("vaapi", StringComparison.OrdinalIgnoreCase) != -1)
{
- arg = "-hwaccel vaapi -hwaccel_output_format yuv420p -vaapi_device " + encodingOptions.VaapiDevice + " " + arg;
+ var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.Options.SubtitleMethod == SubtitleDeliveryMethod.Encode;
+ var hwOutputFormat = "vaapi";
+
+ if (hasGraphicalSubs)
+ {
+ hwOutputFormat = "yuv420p";
+ }
+
+ arg = "-hwaccel vaapi -hwaccel_output_format " + hwOutputFormat + " -vaapi_device " + encodingOptions.VaapiDevice + " " + arg;
}
}