The Free Software Media System - Server Backend & API
Fixed SMI to SRT UTF-16 Encoding bug
Khinenw59518ec87e82
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex 9168dccc8c..c96228f31d 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 Contributorsdiff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.csindex 8677b363fb..9ddfb9b01e 100644--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs@@ -425,7 +425,13 @@ namespace MediaBrowser.MediaEncoding.Subtitlesvar 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;}