Skip to content

Conversation

@budimanjojo
Copy link
Contributor

This flow will extract text based subtitle into .srt file.
Text based codec_name that can be converted by ffmpeg should works, but for now I hardcoded the supported codecs to be subrip, srt, ass, ssa.
It supports detecting forced, default, hearing_impaired subtitle and add them to the filename so Plex and Jellyfin can display it correctly.
Everything can be tuned in the inputs, like selecting languages, inputCodecs, enableHI, enableForced, enableDefault, overwriteFile, useISO6391, etc.

I needed to include some objects from https://github.com/wooorm/iso-639-2 (because it will need to be also in the server and worker node to use it as npm module), they're just mapping for ISO 639-2 to ISO 639-1 language code. This is because Bazarr create subtitle files using ISO 639-1 instead of ISO 639-2 so some people (myself included) prefer to follow the naming scheme to avoid having multiple files for same language.

Extracted subtitles will be in the same directory as the input file.

I can actually just create this as the ffmpegCommand flow but because this will output subtitle files instead of just a video file I think it's better that it is a standalone flow because it's definitely not compatible with the "Remove Subtitle" flow and it might not even be compatible with other ffmpegCommand flows because of how ffmpeg command arguments order matter when you want one command to output multiple files.
Also the fact that I personally will use this flow like so:

               [extract subtitle]
                       |
                       V
             [ffmpegCommand Begin]
                       |
                       V
         [ffmpegCommand RemoveSubtitle]
                       |
                       V
          [other ffmpegCommand flows]
                       |
                       V
             [ffmpegCommand Execute]

The flow will output 1 if there are subtitles extracted and 2 if there's no subtitle extracted.

Signed-off-by: budimanjojo <budimanjojo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant