diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-02-23 11:28:59 -0500 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2016-02-23 11:28:59 -0500 |
| commit | 4b1bfe3f8d2dd46d88b9b8cb2cae024dfbc945eb (patch) | |
| tree | f6e66f56c1f8a29d5d342e20abc74d9bc89ac5f5 /MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs | |
| parent | 5945a0c3be02ac7f3fe81f0f31b76f0fd3134264 (diff) | |
| parent | 7393570c4baee987963c1baa9e785a36183e9855 (diff) | |
Merge pull request #1492 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs')
| -rw-r--r-- | MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs index 4fabed850..aef206f13 100644 --- a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs @@ -460,6 +460,15 @@ namespace MediaBrowser.MediaEncoding.Encoder { if (state.SubtitleStream.IsExternal && !state.SubtitleStream.IsTextSubtitleStream) { + if (state.VideoStream != null && state.VideoStream.Width.HasValue) + { + // This is hacky but not sure how to get the exact subtitle resolution + double height = state.VideoStream.Width.Value; + height /= 16; + height *= 9; + + arg += string.Format(" -canvas_size {0}:{1}", state.VideoStream.Width.Value.ToString(CultureInfo.InvariantCulture), Convert.ToInt32(height).ToString(CultureInfo.InvariantCulture)); + } arg += " -i \"" + state.SubtitleStream.Path + "\""; } } |
