{"id":25239159,"url":"https://github.com/denver-code/cosb","last_synced_at":"2025-09-11T10:39:32.851Z","repository":{"id":225667064,"uuid":"766541341","full_name":"denver-code/cosb","owner":"denver-code","description":"COSB - Call of Subtitle. Add subtitles to your video in the CoD MW I-III style","archived":false,"fork":false,"pushed_at":"2024-03-03T16:05:54.000Z","size":15391,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T18:13:58.385Z","etag":null,"topics":["callofduty","pymovie","python","subtitles","video"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denver-code.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-03-03T14:54:52.000Z","updated_at":"2024-03-03T15:53:35.000Z","dependencies_parsed_at":"2024-03-03T16:37:33.268Z","dependency_job_id":null,"html_url":"https://github.com/denver-code/cosb","commit_stats":null,"previous_names":["denver-code/cosb"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denver-code%2Fcosb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denver-code%2Fcosb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denver-code%2Fcosb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denver-code%2Fcosb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denver-code","download_url":"https://codeload.github.com/denver-code/cosb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393555,"owners_count":20931809,"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":["callofduty","pymovie","python","subtitles","video"],"created_at":"2025-02-11T18:14:06.770Z","updated_at":"2025-04-05T19:38:11.765Z","avatar_url":"https://github.com/denver-code.png","language":"Python","readme":"# [WIP] COSB - Call of Subtitle  \nA simple tool to add subtitles to your video in the CoD MW I-III style.\n\n# Example  \n\n\u003e [Note] Click on image.  \n\u003ca href=\"https://youtu.be/nQP-xHUOZxA\n\" target=\"_blank\"\u003e\u003cimg src=\"http://img.youtube.com/vi/nQP-xHUOZxA/0.jpg\" \nalt=\"nQP-xHUOZxA\" width=\"240\" height=\"180\" border=\"10\" /\u003e\u003c/a\u003e\n![example](example.png)\n\n### Code\n```python\nfrom cosb import add_subtitles_to_video\n\nstyle_file = \"style.json\"\nvideo_file = \"vid.mp4\"\nsubtitle_file = \"subs.json\"\noutput_file = \"output.mp4\"\nadd_subtitles_to_video(video_file, subtitle_file, output_file, style_file)\n```\n\n# Installation\n```bash\ngit clone https://github.com/denver-code/cosb\ncd cosb\npoetry install\n```\n\n# Usage\n1. change the `_style.json` to `style.json` and modify it to your liking\n2. change the `_subtitles_.json` to `subtitles.json` and modify it to your liking. This is the place where you can add your subtitles.\n3. Provide `vid.mp4` in the root directory or rename `_vid.mp4` to `vid.mp4` to use the provided example video.\n\nthen run `main.py`, you able to modify it to your liking or create your own script.\n\n```bash\npoetry run python main.py\n```\n\n# Style\nThe style file is a json file that contains the following fields:\n```json\n{\n    \"nameColors\": {\n        \"enemy\": \"#CD716D\",\n        \"friednly\": \"#86B9E1\",\n        \"neutral\": \"#C5E3BA\"\n    },\n    \"textColors\": {\n        \"general\": \"#F7F7F9\"\n    },\n    \"styles\":{\n        \"stroke\": 0,\n        \"strokeColor\": \"transparent\",\n        \"fontSize\": 24\n    },\n    \"duration\": 3,\n    \"padding\": 100\n}\n```\n\n# Subtitles\n```json\n[\n    {\n        \"name\": \"Captain Price\",\n        \"text\": \"From now.... She's yours.\",\n        \"type\": \"friednly\",\n        \"startTime\": \"00:00:01\"\n    },\n     {\n        \"name\": \"Graves\",\n        \"text\": \"Alright, let's go.\",\n        \"type\": \"enemy\",\n        \"startTime\": \"00:00:02\"\n    }\n]\n```\n\n# Plans\n- [x] Add basic support for multiple characters\n- [x] Render the suptitles from the file\n- [x] Color of the name will be based on the type and will be different from text color\n- [ ] Add support for more video formats\n- [ ] Change location of the subtitles when multiple characters are speaking\n- [ ] Breaking the subtitles into multiple lines when the text is too long\n- [ ] GUI\n- [ ] Add Custom Fonts","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenver-code%2Fcosb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenver-code%2Fcosb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenver-code%2Fcosb/lists"}