{"id":25852568,"url":"https://github.com/protik09/subgen-whisperx","last_synced_at":"2025-03-01T14:20:10.026Z","repository":{"id":276910338,"uuid":"930698524","full_name":"protik09/subgen-whisperx","owner":"protik09","description":"Generate subtitles for any Video or Audio file using the amazing capabilties of WhisperX.","archived":false,"fork":false,"pushed_at":"2025-02-28T04:02:46.000Z","size":9860,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T11:47:41.973Z","etag":null,"topics":["subtitle","subtitles","subtitles-generator","whisper","whisper-ai","whisperx"],"latest_commit_sha":null,"homepage":"https://github.com/protik09/subgen-whisperx","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/protik09.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-11T04:02:33.000Z","updated_at":"2025-02-26T04:19:53.000Z","dependencies_parsed_at":"2025-02-28T05:34:34.118Z","dependency_job_id":null,"html_url":"https://github.com/protik09/subgen-whisperx","commit_stats":null,"previous_names":["protik09/subgen-whisperx"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protik09%2Fsubgen-whisperx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protik09%2Fsubgen-whisperx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protik09%2Fsubgen-whisperx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protik09%2Fsubgen-whisperx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/protik09","download_url":"https://codeload.github.com/protik09/subgen-whisperx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241375165,"owners_count":19952665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["subtitle","subtitles","subtitles-generator","whisper","whisper-ai","whisperx"],"created_at":"2025-03-01T14:20:09.580Z","updated_at":"2025-03-01T14:20:10.016Z","avatar_url":"https://github.com/protik09.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SubGen-WhisperX\r\n\r\nA powerful subtitle generation tool using WhisperX for accurate speech-to-text transcription with precise timestamp alignment.\r\n\r\n## Features\r\n\r\n- 🎯 Accurate speech recognition using WhisperX\r\n- ⚡ GPU acceleration support (CUDA)\r\n- 🎵 Handles both video and audio files\r\n- 📁 Batch processing support\r\n- ⏱️ Performance timing and logging\r\n- 🔧 Multiple language model options\r\n- 🎛️ Configurable compute device selection\r\n\r\n## Prerequisites\r\n\r\n- Python 3.10 or later\r\n- NVIDIA GPU with CUDA 12 support (optional, for GPU acceleration)\r\n- Latest driver from nVidia\r\n- FFmpeg\r\n- Git\r\n\r\n## Installation\r\n\r\n### The easy way\r\n\r\n1. Clone the repository:\r\n\r\n```bash\r\ngit clone https://github.com/protik09/subgen-whisperx.git\r\ncd subgen-whisperx\r\n```\r\n\r\n2. Create and activate a conda environment:\r\n\r\n```bash\r\n.\\activate_venv.ps1\r\n```\r\n\r\nor\r\n\r\n```bash\r\n.\\activate_venv.sh\r\n```\r\n\r\n### The manual way\r\n\r\n1. Clone the repository:\r\n\r\n```bash\r\ngit clone https://github.com/protik09/subgen-whisperx.git\r\ncd subgen-whisperx\r\n```\r\n\r\n2. Create and activate a conda environment:\r\n\r\n```bash\r\nconda create -n whisperx python=3.10 -y\r\nconda activate whisperx\r\n```\r\n\r\n3. Install PyTorch with CUDA support:\r\n\r\n```bash\r\nconda install -y pytorch==2.0.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia\r\n```\r\n\r\n4. Install required packages:\r\n\r\n```bash\r\npip install whisperx ffmpeg coloredlogs halo\r\npip install torch torchaudio --index-url https://download.pytorch.org/whl/cu121 --force-reinstall --no-cache-dir\r\n```\r\n\r\n## Usage\r\n\r\n### Basic Usage\r\n\r\nGenerate subtitles for a single video file:\r\n\r\n```bash\r\npython subgen_whisperx.py -f path/to/video.mp4\r\n```\r\n\r\n### Advanced Options\r\n\r\nProcess all media files in a directory:\r\n\r\n```bash\r\npython subgen_whisperx.py -d path/to/directory\r\n```\r\n\r\nSpecify compute device and model size:\r\n\r\n```bash\r\npython subgen_whisperx.py -f video.mp4 -c cuda -m medium\r\n```\r\n\r\nSet logging level:\r\n\r\n```bash\r\npython subgen_whisperx.py -f video.mp4 -l DEBUG\r\n```\r\n\r\n### Command Line Arguments\r\n\r\n| Argument | Description | Default |\r\n|----------|-------------|---------|\r\n| `-f`, `--file` | Path to input media file | None |\r\n| `-d`, `--directory` | Path to directory containing media files | None |\r\n| `-c`, `--compute_device` | Device for computation (`cuda` or `cpu`) | Auto-detect |\r\n| `-m`, `--model_size` | WhisperX model size | `base.en` |\r\n| `-l`, `--log-level` | Logging level | `ERROR` |\r\n| `-t-, '--txt' | Text file with fille/folder paths | None |\r\n\r\n## Output\r\n\r\nThe script generates SRT subtitle files in the same directory as the input media:\r\n\r\n- Format: `filename.ai-{language}.srt`\r\n- Example: `Meetings-0822.ai-en.srt` for a video called `Meetings-0822.mp4`\r\n\r\n## Troubleshooting\r\n\r\nIf the automatic model selection leads to the CUDA Out of Memory Issue, just manually select \r\nthe next smaller model using the `-m` flag.\r\n\r\n## Performance\r\n\r\n- GPU acceleration provides significantly faster processing\r\n- There is CPU fallback if GPU access fails\r\n- Progress indicators show real-time status\r\n- Performance timing information displayed after completion\r\n\r\n## License\r\n\r\nThis project operates under the MIT Open Source License\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\r\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\r\n4. Push to the branch (`git push origin feature/amazing-feature`)\r\n5. Open a Pull Request\r\n\r\n## Acknowledgments\r\n\r\n- [WhisperX](https://github.com/m-bain/whisperX) for the core transcription technology\r\n- [FFmpeg](https://ffmpeg.org/) for media processing capabilities\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotik09%2Fsubgen-whisperx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotik09%2Fsubgen-whisperx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotik09%2Fsubgen-whisperx/lists"}