{"id":20891245,"url":"https://github.com/extremq/gptsubtitler","last_synced_at":"2025-06-14T17:39:57.394Z","repository":{"id":166078284,"uuid":"641508727","full_name":"extremq/gptsubtitler","owner":"extremq","description":"Automatically subtitle any video spoken in any language to a language of your choice using AI.","archived":false,"fork":false,"pushed_at":"2023-05-18T12:56:48.000Z","size":41,"stargazers_count":56,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-10T07:50:28.217Z","etag":null,"topics":["ai","ffmpeg","gpt","huggingface","openai","subtitles","transcriber","translation","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/extremq.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}},"created_at":"2023-05-16T16:04:13.000Z","updated_at":"2025-05-12T22:05:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad234b40-e8b4-49c8-9745-2415d5d238f6","html_url":"https://github.com/extremq/gptsubtitler","commit_stats":null,"previous_names":["extremq/subtitler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/extremq/gptsubtitler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremq%2Fgptsubtitler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremq%2Fgptsubtitler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremq%2Fgptsubtitler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremq%2Fgptsubtitler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extremq","download_url":"https://codeload.github.com/extremq/gptsubtitler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extremq%2Fgptsubtitler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259858073,"owners_count":22922900,"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":["ai","ffmpeg","gpt","huggingface","openai","subtitles","transcriber","translation","whisper"],"created_at":"2024-11-18T09:11:37.398Z","updated_at":"2025-06-14T17:39:57.359Z","avatar_url":"https://github.com/extremq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Subtitler\nAutomatically subtitle any video spoken in any language to a language of your choice using AI.\n\nModels used:\n- [OpenAI whisper C++ port](https://github.com/ggerganov/whisper.cpp) - for audio-to-text\n- [Facebook M2M10](https://huggingface.co/facebook/m2m100_418M) - for translation\n\nTools used:\n- `ffmpeg`\n\n**Please don't forget to star the repository if you find it useful or educational!**\n\nBefore:\n\nhttps://github.com/extremq/subtitler/assets/45830561/49f6ecce-cfdc-4f1c-97eb-07a36ac841c9\n\nAfter (in Romanian - `model_type=medium, language_model_type=base`):\n\nhttps://github.com/extremq/subtitler/assets/45830561/20bc5169-0ce3-47cd-adb7-15d75daf27f4\n\n# Setup\nInstall using `pip`.\n\n```\npip install gptsubtitler\n```\n\nInstall [`ffmpeg`](https://ffmpeg.org/):\n```bash\n# Ubuntu or Debian\nsudo apt update \u0026\u0026 sudo apt install ffmpeg\n\n# MacOS\nbrew install ffmpeg\n\n# Windows using Chocolatey https://chocolatey.org/\nchoco install ffmpeg\n```\n\n# Quick guide\nExample usage for adding subtitles and translating them in Romanian:\n\nCommand line:\n```bash\ngptsubtitler soldier.mp4 --source_language en --target_language ro --captioning_model_type medium --language_model_type base\n```\n\nOr in Python\n```py\nfrom gptsubtitler import Transcriber\n\n# I strongly recommend using the \"medium\" model_type.\nTranscriber.transcribe(\"soldier.mp4\", source_language=\"en\", target_language=\"ro\", captioning_model_type=\"medium\", language_model_type=\"base\")\n```\n\nYou can also use the `Translator` class from `translator.py` if you just want to translate some text.\n\nExample usage for translating from English to Romanian:\n```py\nfrom gptsubtitler import Translator\n\nprint(Translator.translate(\"Hi!\", target_language=\"ro\", source_language=\"en\"))\n```\n\nIf you have generated a `.srt` file and just want to add subtitles:\n```py\nfrom gptsubtitler import create_video_with_subtitles\ncreate_video_with_subtitles(\"video.mp4\", \"output.srt\", \"video_subtitled.mp4\")\n```\n\n# Options\n```\nArgs:\n    video_file (str): Path to video file.\n\n    output_video_file (str, optional): Path to output video file. Defaults to video_file_subtitled.\n\n    output_subtitle_file (str, optional): Path to output SRT file. Defaults to \"output.srt\".\n\n    source_language (str, optional): Source language for translation. Defaults to en.\n\n    target_language (str, optional): Target language for translation. Defaults to None.\n\n    captioning_model_type (str, optional): Model type. Defaults to \"base\".\n\n    language_model_type (str, optional): Language model type. Defaults to \"base\".\n\n    model_dir (str, optional): Path to model directory. Defaults to None.\n```\n\nAvailable options for `captioning_model_type` (the audio to text model):\n- tiny\n- base - default\n- small\n- medium\n- large\n\nAvailable options for `language_model_type` (the language translator model):\n- base - default\n- large\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextremq%2Fgptsubtitler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextremq%2Fgptsubtitler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextremq%2Fgptsubtitler/lists"}