aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhinenw <deu07115@gmail.com>2019-07-14 23:05:45 +0900
committerKhinenw <deu07115@gmail.com>2019-07-15 12:20:59 +0900
commit59518ec87e828aff21e5f0f67e82f00fc8fa13ba (patch)
tree223678df6a30eae782176a8c516a55409fd37a19
parente94fa791a954a08a35f646ea18bb6dac32d48694 (diff)
Fixed SMI to SRT UTF-16 Encoding bug
-rw-r--r--CONTRIBUTORS.md1
-rw-r--r--MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs8
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;
}