diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-02-22 22:41:30 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-02-22 22:41:30 -0500 |
| commit | 47eb22e25e113a103b59591410fe1edb53f1204e (patch) | |
| tree | 0446f213973759103a1a305141eeb32aad9d9699 /MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs | |
| parent | 55d556863c5e0c1c6f7ab1b1b0383f374ac80e64 (diff) | |
fixes #1481 - Transcoding of sub/idx not working
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 + "\""; } } |
