jellyfin / jellyfin-plugin-subtitleextract

GNU General Public License v3.0
38 stars 9 forks source link

Subtitle "Unsupported format" errors with subtitleextract plugin v3 and jellyfin server v10.9.0 #25

Closed RealGreenDragon closed 4 months ago

RealGreenDragon commented 4 months ago

Hi,

after upgrading subtitleextract plugin to v3 and jellyfin server to v10.9.0 I see many "Unsupported format" during subtitle extraction.

For now I see two "Unsupported format" error types:

[2024-05-12 16:53:29.643 +02:00] [INF] [10] Jellyfin.Plugin.SubtitleExtract.Tools.SubtitlesExtractor: Extracting subtitles from "<FILE_PATH>"
[2024-05-12 16:53:29.649 +02:00] [WRN] [10] Jellyfin.Plugin.SubtitleExtract.Tools.SubtitlesExtractor: Unable to extract subtitle File:"<FILE_PATH>"
System.ArgumentException: Unsupported format: srt
   at MediaBrowser.MediaEncoding.Subtitles.SubtitleEditParser.Parse(Stream stream, String fileExtension)
   at MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder.ConvertSubtitles(Stream stream, String inputFormat, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder.MediaBrowser.Controller.MediaEncoding.ISubtitleEncoder.GetSubtitles(BaseItem item, String mediaSourceId, Int32 subtitleStreamIndex, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
   at Jellyfin.Plugin.SubtitleExtract.Tools.SubtitlesExtractor.Run(BaseItem video, CancellationToken cancellationToken)

[2024-05-12 16:53:29.652 +02:00] [INF] [10] Jellyfin.Plugin.SubtitleExtract.Tools.SubtitlesExtractor: Extracting subtitles from "<FILE_PATH>"
[2024-05-12 16:53:29.745 +02:00] [WRN] [10] Jellyfin.Plugin.SubtitleExtract.Tools.SubtitlesExtractor: Unable to extract subtitle File:"<FILE_PATH>"
System.ArgumentException: Unsupported format: mov_text
   at MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder.GetWriter(String format)
   at MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder.ConvertSubtitles(Stream stream, String inputFormat, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Subtitles.SubtitleEncoder.MediaBrowser.Controller.MediaEncoding.ISubtitleEncoder.GetSubtitles(BaseItem item, String mediaSourceId, Int32 subtitleStreamIndex, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
   at Jellyfin.Plugin.SubtitleExtract.Tools.SubtitlesExtractor.Run(BaseItem video, CancellationToken cancellationToken)

The case one is very strange, as srt subtitle format should be supported (maybe there was a string comparison check issue?).

In case two mov_text subtitle format should be converted in srt as done in subtitleextract plugin v2 for every subtitle form that is not srt, ass, or ssa.

ps. I'm not sure if the issue should be opened in subtitleextract plugin repo or jellyfin server repo.

crobibero commented 4 months ago

Fixed in https://github.com/jellyfin/jellyfin-plugin-subtitleextract/commit/a327386da62dd92b036b66b956a3d962b23f929b