This AI-Dubbing plugin is experimental and may contain bugs or unstable functionality. Use at your own risk. The plugin is still under active development and may not work as expected in all scenarios.
This repository contains Tdarr Flow plugins for AI-powered dubbing and audio processing.
The AI-Dubbing plugin is a Tdarr Flow plugin that enables automated dubbing of video files using AI services. It transcribes audio from video files, translates the transcribed text into a target language, and synthesizes new speech in the target language, which is then muxed back into the original video file.
- Audio Transcription: Uses AI services to transcribe audio from video files
- Text Translation: Translates transcribed text into a specified target language
- Text-to-Speech Synthesis: Converts translated text back into speech
- Audio Muxing: Merges the synthesized audio back into the original video file as the last audio stream
- Configurable API Endpoint: Supports custom API endpoints (defaulting to Speaches API)
- Flexible Audio Stream Selection: Can process specific audio streams from multi-audio files
- Debug Logging: Optional detailed logging for troubleshooting
- Extracts the specified audio stream from the input video file
- Sends the audio to an AI transcription service to generate text
- Translates the transcribed text to the target language
- Synthesizes speech from the translated text using a text-to-speech service
- Muxes the new synthesized audio back into the video file as the last audio stream
The plugin accepts the following inputs:
- API Endpoint URL: Base URL of the AI service API (default: https://api.speaches.ai)
- Target Language: Language code for translation (default: en)
- Audio Stream Index: Index of the audio stream to process (default: 0)
- Enable Debug Logging: Toggle detailed logging for debugging purposes
- Tdarr Server v2.11.01 or higher
- FFmpeg installed and accessible
- Access to an AI transcription/translation/synthesis API service
- The plugin is designed to work with the Speaches AI service: https://github.com/speaches-ai/speaches (openai compatible API endpoints that can run locally)
- Add the plugin to your Tdarr Flow pipeline
- Configure the API endpoint URL and target language
- Specify the audio stream index to process
- Enable debug logging if needed for troubleshooting
- Run the pipeline to process your video files
Make sure NodeJS v16 is installed
Install dependencies:
npm install
Run ESLint:
npm run lint:fix
Check plugins using some extra custom rules:
npm run checkPlugins
Run tests:
npm run test
- Clone this repo
- Set env variable
pluginsDirto the location of the plugins repo and run Tdarr Server and Node. E.g.export pluginsDir=C:/Tdarr_Plugins - Browse the typescript plugins here https://github.com/HaveAGitGat/Tdarr_Plugins/tree/master/FlowPluginsTs/CommunityFlowPlugins and make edits locally or create a new one locally:
- Make sure typescript is intalled with
npm i -g typescriptthen runtscto compile the changes. - Refresh the browser and Tdarr will pick up the changes
Note, pluginsDir directories that contain a .git folder (such as when cloning this repo) will cause Tdarr to skip plugin updates to prevent overwriting development changes.
This repository uses GitHub Actions to automatically sync plugin updates to the main Tdarr_Plugins repository.
When changes are pushed to the main branch of this repository, the GitHub Action will:
- Copy the plugin files to the main Tdarr_Plugins repository
- Commit and push the changes to the main repository
To manually sync changes:
- Clone the main Tdarr_Plugins repository
- Copy the plugin files from
FlowPlugins/CommunityFlowPlugins/audio/AI-Dubbing/1.0.0/andFlowPluginsTs/CommunityFlowPlugins/audio/AI-Dubbing/1.0.0/ - Commit and push to the main repository
The workflow is now configured and active. The AI-Dubbing plugin has been updated with an experimental warning and will automatically sync to the main Tdarr_Plugins repository when changes are pushed to the main branch.
FlowPlugins/
└─ CommunityFlowPlugins/
└─ audio/
└─ AI-Dubbing/
└─ 1.0.0/
└─ index.js
FlowPluginsTs/
└─ CommunityFlowPlugins/
└─ audio/
└─ AI-Dubbing/
└─ 1.0.0/
└─ index.ts