Name | dubbify JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | Create AI-generated dubbed audio tracks for media via CLI and SDK |
upload_time | 2025-10-06 12:30:03 |
maintainer | None |
docs_url | None |
author | Amr Osama |
requires_python | >=3.9 |
license | MIT License
Copyright (c) 2025 Amr Osama
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. |
keywords |
dubbing
audio
tts
transcription
cli
sdk
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Dubbify
Create AI-generated dubbed audio tracks for media via CLI and SDK.
**Author:** Amr Osama
**Repository:** https://github.com/thehorse2000/dubbify
## Installation
```bash
pip install dubbify
```
## Dependencies
- Python 3.9
- Python packages (installed automatically with `pip install dubbify`):
- typer0.12.3
- rich13.7.1
- pydantic2.7.1
- srt3.5.3
- pydub0.25.1
- ffmpeg-python0.2.0
- elevenlabs1.3.1
- openai1.40.0
- System dependency: FFmpeg (required for audio processing and muxing)
Install FFmpeg:
```bash
# Ubuntu/Debian
sudo apt-get update && sudo apt-get install -y ffmpeg
# macOS (Homebrew)
brew install ffmpeg
# Windows (Chocolatey)
choco install ffmpeg
```
## Configuration
Set API keys and default model as environment variables:
```bash
export OPENAI_API_KEY="sk-..." # used for transcription only
export ELEVENLABS_API_KEY="your_elevenlabs_key" # used for TTS only
export DUBBIFY_TTS_MODEL="eleven_multilingual_v2" # optional, defaults to eleven_multilingual_v2
```
## CLI Usage
- End-to-end:
```bash
dubbify run \
--input path/to/video.mp4 \
--output path/to/dubbed_video.mp4 \
--voice asDeXBMC8hUkhqqL7agO \
--language en
```
- Transcribe only:
```bash
dubbify transcribe \
--input path/to/video.mp4 \
--output path/to/transcript.srt \
--language en
```
- Dub from SRT:
```bash
dubbify dub \
--input path/to/transcript.srt \
--output path/to/dubbed_audio.mp3 \
--voice asDeXBMC8hUkhqqL7agO
```
Notes:
- `--voice-id` can be provided to use the ElevenLabs Convert endpoint explicitly; if omitted, `--voice` is treated as the ID.
- `--output` accepts `.mp3` (audio only) or `.mp4` (video with replaced audio).
- Run `dubbify --help` to list all options.
## SDK Usage
```python
from dubbify import Dubbify, DubbifyConfig
config = DubbifyConfig(voice="Bella", language="en")
project = Dubbify(config=config)
project.run(input_path="path/to/video.mp4", output_path="path/to/dubbed_video.mp4")
```
More examples:
```python
# Transcribe to an SRT file
project.transcribe(input_path="path/to/video.mp4", output_srt_path="out.srt")
# Generate dubbed audio from an existing SRT
project.dub(srt_path="out.srt", output_audio_path="dubbed.mp3")
```
## How it Works
- Transcription pipeline:
- Extracts audio from video with FFmpeg when needed.
- Splits long audio into size-limited chunks for reliable cloud transcription.
- Uses OpenAI Whisper (translations for English target, transcriptions otherwise) to produce time-stamped segments.
- Optionally translates subtitles when a non-English `language` is set.
- Optionally refines SRT timings via an OpenAI text model to improve dubbing pace while preserving total duration.
- Dubbing pipeline:
- For each subtitle line, synthesizes speech with ElevenLabs.
- Prefers the modern Convert endpoint when available (`voice_id` or `voice` as ID); otherwise falls back to `generate`.
- Measures each synthesized clip’s duration and schedules overlays using a forward-push plus backward reconciliation algorithm to keep the final end time consistent.
- Assembles a single audio track and, if output is `.mp4`, swaps the original audio with the dubbed track using FFmpeg while copying the video stream.
Environment requirements:
- `OPENAI_API_KEY` is required for transcription/translation and timing refinement.
- `ELEVENLABS_API_KEY` is required for TTS.
- FFmpeg must be installed and available on PATH.
## License
MIT
Raw data
{
"_id": null,
"home_page": null,
"name": "dubbify",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "dubbing, audio, tts, transcription, cli, sdk",
"author": "Amr Osama",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/bb/d7/b185f5293b04b3a900e2d393e9897ec266e4623f80613d06ce6a16fa72d5/dubbify-0.0.1.tar.gz",
"platform": null,
"description": "# Dubbify\n\nCreate AI-generated dubbed audio tracks for media via CLI and SDK.\n\n**Author:** Amr Osama \n**Repository:** https://github.com/thehorse2000/dubbify\n\n## Installation\n\n```bash\npip install dubbify\n```\n\n## Dependencies\n\n- Python \u00193.9\n- Python packages (installed automatically with `pip install dubbify`):\n - typer\u00190.12.3\n - rich\u001913.7.1\n - pydantic\u00192.7.1\n - srt\u00193.5.3\n - pydub\u00190.25.1\n - ffmpeg-python\u00190.2.0\n - elevenlabs\u00191.3.1\n - openai\u00191.40.0\n- System dependency: FFmpeg (required for audio processing and muxing)\n\nInstall FFmpeg:\n\n```bash\n# Ubuntu/Debian\nsudo apt-get update && sudo apt-get install -y ffmpeg\n\n# macOS (Homebrew)\nbrew install ffmpeg\n\n# Windows (Chocolatey)\nchoco install ffmpeg\n```\n\n## Configuration\n\nSet API keys and default model as environment variables:\n\n```bash\nexport OPENAI_API_KEY=\"sk-...\" # used for transcription only\nexport ELEVENLABS_API_KEY=\"your_elevenlabs_key\" # used for TTS only\nexport DUBBIFY_TTS_MODEL=\"eleven_multilingual_v2\" # optional, defaults to eleven_multilingual_v2\n```\n\n## CLI Usage\n\n- End-to-end:\n\n```bash\ndubbify run \\\n --input path/to/video.mp4 \\\n --output path/to/dubbed_video.mp4 \\\n --voice asDeXBMC8hUkhqqL7agO \\\n --language en\n```\n\n- Transcribe only:\n\n```bash\ndubbify transcribe \\\n --input path/to/video.mp4 \\\n --output path/to/transcript.srt \\\n --language en\n```\n\n- Dub from SRT:\n\n```bash\ndubbify dub \\\n --input path/to/transcript.srt \\\n --output path/to/dubbed_audio.mp3 \\\n --voice asDeXBMC8hUkhqqL7agO\n```\n\nNotes:\n- `--voice-id` can be provided to use the ElevenLabs Convert endpoint explicitly; if omitted, `--voice` is treated as the ID.\n- `--output` accepts `.mp3` (audio only) or `.mp4` (video with replaced audio).\n- Run `dubbify --help` to list all options.\n\n## SDK Usage\n\n```python\nfrom dubbify import Dubbify, DubbifyConfig\n\nconfig = DubbifyConfig(voice=\"Bella\", language=\"en\")\nproject = Dubbify(config=config)\nproject.run(input_path=\"path/to/video.mp4\", output_path=\"path/to/dubbed_video.mp4\")\n```\n\nMore examples:\n\n```python\n# Transcribe to an SRT file\nproject.transcribe(input_path=\"path/to/video.mp4\", output_srt_path=\"out.srt\")\n\n# Generate dubbed audio from an existing SRT\nproject.dub(srt_path=\"out.srt\", output_audio_path=\"dubbed.mp3\")\n```\n\n## How it Works\n\n- Transcription pipeline:\n - Extracts audio from video with FFmpeg when needed.\n - Splits long audio into size-limited chunks for reliable cloud transcription.\n - Uses OpenAI Whisper (translations for English target, transcriptions otherwise) to produce time-stamped segments.\n - Optionally translates subtitles when a non-English `language` is set.\n - Optionally refines SRT timings via an OpenAI text model to improve dubbing pace while preserving total duration.\n\n- Dubbing pipeline:\n - For each subtitle line, synthesizes speech with ElevenLabs.\n - Prefers the modern Convert endpoint when available (`voice_id` or `voice` as ID); otherwise falls back to `generate`.\n - Measures each synthesized clip\u2019s duration and schedules overlays using a forward-push plus backward reconciliation algorithm to keep the final end time consistent.\n - Assembles a single audio track and, if output is `.mp4`, swaps the original audio with the dubbed track using FFmpeg while copying the video stream.\n\nEnvironment requirements:\n- `OPENAI_API_KEY` is required for transcription/translation and timing refinement.\n- `ELEVENLABS_API_KEY` is required for TTS.\n- FFmpeg must be installed and available on PATH.\n\n## License\n\nMIT\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2025 Amr Osama\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.",
"summary": "Create AI-generated dubbed audio tracks for media via CLI and SDK",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/thehorse2000/dubbify",
"Repository": "https://github.com/thehorse2000/dubbify"
},
"split_keywords": [
"dubbing",
" audio",
" tts",
" transcription",
" cli",
" sdk"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9435667e5fffcae4641cae958d20830e5f29316c68663f4ccd7d22b0aacde507",
"md5": "23d10eb00e98fff3d943b54569a6e5c5",
"sha256": "dd188a6c930e437b336a89a27c15eb048da0550a3bb74b6e2c7948448f4266cb"
},
"downloads": -1,
"filename": "dubbify-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "23d10eb00e98fff3d943b54569a6e5c5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 15455,
"upload_time": "2025-10-06T12:30:02",
"upload_time_iso_8601": "2025-10-06T12:30:02.253951Z",
"url": "https://files.pythonhosted.org/packages/94/35/667e5fffcae4641cae958d20830e5f29316c68663f4ccd7d22b0aacde507/dubbify-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "bbd7b185f5293b04b3a900e2d393e9897ec266e4623f80613d06ce6a16fa72d5",
"md5": "f8ca2842bec5dd83575b61ad07f000e1",
"sha256": "703f212720af8dc839558df4dd4c07e80837ede11dbdb5f8debc19f9e6c932ad"
},
"downloads": -1,
"filename": "dubbify-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "f8ca2842bec5dd83575b61ad07f000e1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 15670,
"upload_time": "2025-10-06T12:30:03",
"upload_time_iso_8601": "2025-10-06T12:30:03.506714Z",
"url": "https://files.pythonhosted.org/packages/bb/d7/b185f5293b04b3a900e2d393e9897ec266e4623f80613d06ce6a16fa72d5/dubbify-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-06 12:30:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thehorse2000",
"github_project": "dubbify",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "dubbify"
}