diff options
| author | Anthony Lavado <anthonylavado@users.noreply.github.com> | 2019-07-28 00:42:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-28 00:42:21 -0400 |
| commit | a8014b3942a27912b99e1de7cbf3b4d7ec3d8678 (patch) | |
| tree | 7b76ad4392ae45e984fb221b6fdc72055532dc63 | |
| parent | 85b277b872757d464c701e11350b47a07d98bf82 (diff) | |
| parent | 59518ec87e828aff21e5f0f67e82f00fc8fa13ba (diff) | |
Merge pull request #1540 from HelloWorld017/sami-fix
Fixed SMI Encoding Bug
| -rw-r--r-- | CONTRIBUTORS.md | 1 | ||||
| -rw-r--r-- | MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9168dccc8..c96228f31 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -27,6 +27,7 @@ - [pjeanjean](https://github.com/pjeanjean) - [DrPandemic](https://github.com/drpandemic) - [joern-h](https://github.com/joern-h) + - [Khinenw](https://github.com/HelloWorld017) # Emby Contributors diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index 8677b363f..9ddfb9b01 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -425,7 +425,13 @@ namespace MediaBrowser.MediaEncoding.Subtitles var encodingParam = await GetSubtitleFileCharacterSet(inputPath, language, inputProtocol, cancellationToken).ConfigureAwait(false); - if (!string.IsNullOrEmpty(encodingParam)) + // FFmpeg automatically convert character encoding when it is UTF-16 + // If we specify character encoding, it rejects with "do not specify a character encoding" and "Unable to recode subtitle event" + if ((inputPath.EndsWith(".smi") || inputPath.EndsWith(".sami")) && (encodingParam == "UTF-16BE" || encodingParam == "UTF-16LE")) + { + encodingParam = ""; + } + else if (!string.IsNullOrEmpty(encodingParam)) { encodingParam = " -sub_charenc " + encodingParam; } |
