This guide outlines how to set up Bazarr for automatic, perfectly synced subtitle generation using Whisper-ASR and Aeneas. This solution is ideal for users who want precise subtitle synchronization without manually searching for synced subtitles. Note that this process works best for English source videos and subtitles.
This guide is perfect for users who:
- Want perfectly synced subtitles for their media.
- Don’t mind minor literal translation inaccuracies.
- Prefer an automated pipeline for subtitle generation.
The setup involves leveraging Whisper-ASR for subtitle creation and Aeneas for fine-tuned subtitle synchronization.
Before you begin, ensure you have the following:
- Bazarr installed and configured with ARR tools like Sonarr and Radarr.
- Basic familiarity with ARR workflows.
- A system capable of running Whisper-ASR (preferably with GPU support for faster processing).
In Bazarr, add the following custom post-processing command in your configuration:
/config/postproces.sh "{{episode}}" "{{subtitles}}" "{{provider}}"
- The source language for this setup is English.
- Non-English source languages are not currently supported.
Modify the postproces.sh
script in your Bazarr config directory. The script should handle the following:
- Identify if the subtitle provider is Whisper.
- Run post-processing only for Whisper; otherwise, exit without making changes.
- The Flask app interacts with the video file and subtitle file.
- It converts the video to
.mp3
format and syncs subtitles using Aeneas. - After processing:
- The original subtitle is replaced with the synced version.
- The intermediate
.mp3
file is deleted.
- The resulting English subtitle file is perfectly synced with the video.
You can then use Bazarr’s translate option to convert these synced subtitles into other languages.
- The Flask app communicates with Aeneas running on
aeneas:5000
. - The script sends the following parameters:
series_path
: Path to the video file.subtitle_path
: Path to the subtitle file.provider
: The subtitle provider.
- If using Whisper-ASR, GPU support is highly recommended for efficiency.
- Modify your Docker Compose file to specify the desired Whisper model or version.
- Input: English video source.
- Processing:
- Generate English subtitles using Whisper-ASR.
- Sync subtitles perfectly with the video using Aeneas.
- Output:
- Use Bazarr’s mass-translate feature to generate subtitles in other languages.
- This solution is tailored for English source to English subtitle workflows (for now).
- GPU support for Whisper is crucial for faster processing.
- Tutorials for configuring Whisper with Docker Compose can be found on the Bazarr Wiki.
This project was born out of the frustration of finding high-quality, perfectly synced subtitles. With this setup, you can ensure a seamless experience for all your media.
Happy subtitle syncing!