SubtitleCreator is a command line utility to generate subtitles for a video file and optionally put into a MKV container. It is written in C# with executables available for multiple operating systems. It uses Whisper.NET and ffmpeg to generate the subtitles.
- Decompress the proper file for your operating system into a folder.
- Decompress the runtime file such that the end result is a runtime folder in the same folder as the SubtitleCreator executable.
- The ffmpeg executable must be available on your system. It can be downloaded from ffmpeg.org
- -ffmpegPath=Path to the ffmpeg executable. Just the folder, the exe is assumed to be ffmpeg.exe or ffmpeg.
- -inFile=The video file the subtitles will be generated for.
- Optional: -nomerge By default once the subtitle file is created, it is merged into a MKV container along with the video file. If this parameter is used, the MKV container will not be created and the subtitle file will not be deleted.
- Optional: -translate If this is used, subtitles will be translated to English. Do not use if the audio is already in English.
- Optional: -detectAudioLanguage Automatically detect the language of the audio. Set the audioLanguage parameter if this is false. Default false.
- Optional: -audioLanguage= Set this if detectAudioLanguage is false and the audio is not in english. English is the default.
- Optional: -language=The language of the audio and therefore the subtitles. en for example is english. This is used for the naming of the subtitles file. Default is none.
- Optional: -Model= Options are Small/Medium/Large. Bigger is better quality, but also slower. Default = Medium.
- Optional: -noRepair Sometimes a recording will have audio errors that stop the processing. By default, the app will attempt to make repairs. Use of this flag aborts the repair and the app just fails.
- Optional: -noSDH Do not generate descriptive lines such as [grunting]. By default, the descriptive (SDH) subtitles will be included.
- Optional: -forceModelUpdate Force the update of the Whisper model. If set, the model will be downloaded even if it already exists. Default: false.
- Optional: -shutDown If set, the system will be shutdown when complete. Note that this likely only works on Windows.
For the Emby software package (and I believe also for Jellyfin and Plex) you can specify a command to be executed after a recording has completed.
This is a windows batch file that will run SubtitleCreator to create an SRT subtitle file for the recording automatically in Emby.
set drive=%~d1
set folder=%~p1
set filename=%~n1
c:
cd\SubtitleCreator
SubtitleCreator -ffmpegpath="C:\ffmpeg\bin" -infile="%drive%%folder%%filename%.ts" -model=medium -nomerge
For a list of possible audioLanguages, run SubtitleCreator -LanguageList.
Based on my testing, using the medium model does a great job. However, depending upon the strength of your machine running this app, it can take quite a while to generate the subtitles. My box is several years old and by no means a supercomputer but not a boat anchor either, a recording that was 66 minutes in length took 60 minutes to generate the SRT file.
SubtitleCreator is CharityWare. If you like this program and find it of value, please consider making a donation to a local charity that benefits children such as Special Olympics.
- @trananh1992 for creating the WinWhisper-SRT project.