{"id":15136528,"url":"https://github.com/sivakumar-mahalingam/subtitle-generator","last_synced_at":"2026-03-07T07:32:22.521Z","repository":{"id":245147382,"uuid":"815481241","full_name":"sivakumar-mahalingam/subtitle-generator","owner":"sivakumar-mahalingam","description":"🎞️ Automatically generating subtitles for video files using Whisper ASR model in Python","archived":false,"fork":false,"pushed_at":"2024-07-07T10:11:17.000Z","size":97648,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T08:16:05.846Z","etag":null,"topics":["ai","audio-model","audio-processing","automatic-speech-recognition","openai-whisper","python","speech-recognition","speech-to-text","subtitle-generator","whisper"],"latest_commit_sha":null,"homepage":"","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/sivakumar-mahalingam.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":"2024-06-15T09:37:00.000Z","updated_at":"2024-07-07T10:11:21.000Z","dependencies_parsed_at":"2025-02-08T14:42:03.806Z","dependency_job_id":null,"html_url":"https://github.com/sivakumar-mahalingam/subtitle-generator","commit_stats":null,"previous_names":["sivakumar-mahalingam/subtitle-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sivakumar-mahalingam/subtitle-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivakumar-mahalingam%2Fsubtitle-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivakumar-mahalingam%2Fsubtitle-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivakumar-mahalingam%2Fsubtitle-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivakumar-mahalingam%2Fsubtitle-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sivakumar-mahalingam","download_url":"https://codeload.github.com/sivakumar-mahalingam/subtitle-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivakumar-mahalingam%2Fsubtitle-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai","audio-model","audio-processing","automatic-speech-recognition","openai-whisper","python","speech-recognition","speech-to-text","subtitle-generator","whisper"],"created_at":"2024-09-26T06:22:27.760Z","updated_at":"2026-03-07T07:32:22.500Z","avatar_url":"https://github.com/sivakumar-mahalingam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Subtitle Generator\n\nThis repository provides a Python script to generate subtitle files (`.srt`) for a given video file. The script extracts audio from the video, transcribes the audio using OpenAI's Whisper model, and generates an `.srt` file with the transcription and timestamps.\n\n## SRT Files\n\nSRT (.srt) files are the most common type of closed caption file format. SRT stands for “SubRip Subtitle” file.\n\nAn SRT file includes:\n\n- The number of the closed caption frame in sequence\n- Beginning and end timecodes for when the closed caption frame should appear\n- The closed caption itself\n- A blank link to indicate the start of a new closed caption sequence\n\n![img.png](docs%2Fimg.png)\n\n## Features\n\n- Extracts audio from video files using `ffmpeg`.\n- Transcribes audio to text with timestamps using OpenAI's Whisper model.\n- Generates `.srt` subtitle files.\n\n## Requirements\n\n- `Python 3.7+`\n- `ffmpeg`\n- `torch`\n- `openai-whisper`\n\n## Installation\n\n1. **Install `ffmpeg`**: \n\n   Make sure `ffmpeg` is installed on your system. You can download it from [ffmpeg.org](https://ffmpeg.org/download.html) and follow the installation instructions for your operating system.\n\n2. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/yourusername/subtitle-generator.git\n   cd subtitle-generator\n   ```\n\n3. **Create a virtual environment and activate it**:\n\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n   ```\n\n4. **Install the required Python packages**:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\n1. **Provide the path to the video file**:\n\n   Ensure you have the video file path ready. The script will process this file to generate subtitles.\n\n2. **Run the script**:\n   \n   Update all file paths (.srt, .wav, .mp4) in the script\n   ```bash\n   python generate_subtitles.py\n   ```\n\n3. **Output**:\n\n   The script will create a `.srt` file with the same name as the video file in the same directory.\n\n## Script Overview\n\n### `generate_subtitles.py`\n\nThis is the main script that performs the following steps:\n\n1. **Extract audio from the video file**:\n   \n   Uses `ffmpeg` to extract audio from the provided video file and save it as a `.wav` file.\n\n2. **Transcribe the audio file**:\n   \n   Utilizes OpenAI's Whisper model to transcribe the audio into text with timestamps.\n\n3. **Create the `.srt` file**:\n   \n   Generates an `.srt` file with the transcribed text and timestamps.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.\n\n## Acknowledgements\n\n- [OpenAI Whisper](https://github.com/openai/whisper) for the transcription model.\n- [ffmpeg](https://ffmpeg.org/) for audio extraction.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivakumar-mahalingam%2Fsubtitle-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsivakumar-mahalingam%2Fsubtitle-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivakumar-mahalingam%2Fsubtitle-generator/lists"}