# video-subtitles
Adds subtitles to a movie.
[![Linting](https://github.com/zackees/video-subtitles/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/video-subtitles/actions/workflows/lint.yml)
[![MacOS_Tests](https://github.com/zackees/video-subtitles/actions/workflows/push_macos.yml/badge.svg)](https://github.com/zackees/video-subtitles/actions/workflows/push_macos.yml)
[![Ubuntu_Tests](https://github.com/zackees/video-subtitles/actions/workflows/push_ubuntu.yml/badge.svg)](https://github.com/zackees/video-subtitles/actions/workflows/push_ubuntu.yml)
[![Win_Tests](https://github.com/zackees/video-subtitles/actions/workflows/push_win.yml/badge.svg)](https://github.com/zackees/video-subtitles/actions/workflows/push_win.yml)
Run tox until it's correct.
To develop software, run `. ./activate.sh`
# Install
#### Install Python 3.10
* Click the following:
* https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe
* During install MAKE SURE YOU CLICK "ADD TO PATHS" (or similar)
* You only need to do this once
#### Install videosubtitles tool
* Open up a windows command terminal
* Hit the "Windows Key" + r
* type in `cmd` and hit `enter` on the keyboard
* type in `pip install video-subtitles`
* Close the windows command terminal
It should now be installed.
# First run
* Keep in mind that the first run will take a lot of time as it downloads the proper drivers for your computer. But this will only be done once. Also there is an API key
that you will be asked about, you can skip this by putting in `free` as the key.
# Running
* Open up a windows command terminal, as described in the previous step
* `cd` to your video directory where you video is at
* type in the following `videosubtitles myvideo.mp4 --languages es,fr,zh,it`
* This will generate English, French, Chinese, Italian subtitles
* For other subtitle languages see the language reference below
* On the first run, you will be asked to enter in an API key from DeepL, the english -> Language X translation service. This KEY is free for upto 500,000 characters per month. If you don't like this then you can use the word `free` instead and special code will attempt to interact with the website
and use point and clicks to get free translations. However this is extremely slow as pages need to
be clicked by a bot. Also the translations are uploaded in chunks so you might get weird translations
at the cutoff point. While the API key will be lightning fast and the translations have been verified
to be excellent quality. Also, this free mode may break unexpectadly in the future.
* After the translations are done, you'll get a new folder that is the name of the video with "test_" prepended to it. So `myvideo.mp4` will generate a "text_myvideo" with srt files for all the languages
* in the example above, you would get
* `text_myvideo/en.srt`
* `text_myvideo/es.srt`
* `text_myvideo/fr.srt`
* `text_myvideo/zh.srt`
* `text_myvideo/it.srt`
# How it works
* Translation from audio -> en.srt is performed by `transcribe-anything`
* Sadly, `transcribe-anything` can only translate to english subtitles.
* After the english is generated, DeepL is used as a backend service to translate to english to all other languages.
# Language Reference
### Language Inputs
We use openai whisper for language input. See whisper ai documents for a full supported list
### Language outputs
We use the deepl AI for translation. The language list is as follows:
```
BG - Bulgarian
CS - Czech
DA - Danish
DE - German
EL - Greek
EN - English (unspecified variant for backward compatibility; please select EN-GB or EN-US instead)
EN-GB - English (British)
EN-US - English (American)
ES - Spanish
ET - Estonian
FI - Finnish
FR - French
HU - Hungarian
ID - Indonesian
IT - Italian
JA - Japanese
KO - Korean
LT - Lithuanian
LV - Latvian
NB - Norwegian (Bokmål)
NL - Dutch
PL - Polish
PT-BR - Portuguese (Brazilian)
PT-PT - Portuguese (all Portuguese varieties excluding Brazilian Portuguese)
RO - Romanian
RU - Russian
SK - Slovak
SL - Slovenian
SV - Swedish
TR - Turkish
UK - Ukrainian
ZH - Chinese (simplified)
```
Please see [https://www.deepl.com/docs-api/translate-text/](https://www.deepl.com/docs-api/translate-text/) for more information
# Windows
This environment requires you to use `git-bash`.
# Linting
Run `./lint.sh` to find linting errors using `ruff`, `pylint`, `flake8` and `mypy`.
# Releases
* 1.0.11: Fix macos
* 1.0.10: Allows app to run when not using hardware acceleration for AI.
* 1.0.9: Fix settings.json bug in not created directories.
* 1.0.8: Adds password field and centralizes settings.json under appdirs.
* 1.0.7: Adds progress bar when doing work.
* 1.0.6: Adds gui language help for language codes.
* 1.0.5: Adds webvtt format option.
* 1.0.4: Adds thread processor so that multiple files can be done one at a time.
* 1.0.3: Adds gui.
* 1.0.2: Fix bug.
* 1.0.1: Adds retry to translation step. Also alerts when the video is done.
* 1.0.0: Initial release.
# Future Work
### Text to Speech
It would be a good idea to convert the subtitles into a spoken track that can be integrates into a video
* Eleven labs API
* Website: https://beta.elevenlabs.io/
* Rest API: https://docs.elevenlabs.io/api-reference/text-to-speech-stream
* Python API: https://github.com/elevenlabs/elevenlabs-python
Raw data
{
"_id": null,
"home_page": "https://github.com/zackees/video-subtitles",
"name": "video-subtitles",
"maintainer": "Zachary Vorhies",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "template-python-cmd",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/b7/80/61313ef8330e3eac81b56f8aa9e263ca287c65cadce4e1603a436bdb5121/video-subtitles-1.0.11.tar.gz",
"platform": null,
"description": "# video-subtitles\n\nAdds subtitles to a movie.\n\n[![Linting](https://github.com/zackees/video-subtitles/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/video-subtitles/actions/workflows/lint.yml)\n\n[![MacOS_Tests](https://github.com/zackees/video-subtitles/actions/workflows/push_macos.yml/badge.svg)](https://github.com/zackees/video-subtitles/actions/workflows/push_macos.yml)\n[![Ubuntu_Tests](https://github.com/zackees/video-subtitles/actions/workflows/push_ubuntu.yml/badge.svg)](https://github.com/zackees/video-subtitles/actions/workflows/push_ubuntu.yml)\n[![Win_Tests](https://github.com/zackees/video-subtitles/actions/workflows/push_win.yml/badge.svg)](https://github.com/zackees/video-subtitles/actions/workflows/push_win.yml)\n\nRun tox until it's correct.\n\nTo develop software, run `. ./activate.sh`\n\n# Install\n\n#### Install Python 3.10\n\n * Click the following:\n * https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe\n * During install MAKE SURE YOU CLICK \"ADD TO PATHS\" (or similar)\n * You only need to do this once\n\n#### Install videosubtitles tool\n\n * Open up a windows command terminal\n * Hit the \"Windows Key\" + r\n * type in `cmd` and hit `enter` on the keyboard\n * type in `pip install video-subtitles`\n * Close the windows command terminal\n\nIt should now be installed.\n\n# First run\n\n * Keep in mind that the first run will take a lot of time as it downloads the proper drivers for your computer. But this will only be done once. Also there is an API key\n that you will be asked about, you can skip this by putting in `free` as the key.\n\n# Running\n\n * Open up a windows command terminal, as described in the previous step\n * `cd` to your video directory where you video is at\n * type in the following `videosubtitles myvideo.mp4 --languages es,fr,zh,it`\n * This will generate English, French, Chinese, Italian subtitles\n * For other subtitle languages see the language reference below\n * On the first run, you will be asked to enter in an API key from DeepL, the english -> Language X translation service. This KEY is free for upto 500,000 characters per month. If you don't like this then you can use the word `free` instead and special code will attempt to interact with the website\n and use point and clicks to get free translations. However this is extremely slow as pages need to\n be clicked by a bot. Also the translations are uploaded in chunks so you might get weird translations\n at the cutoff point. While the API key will be lightning fast and the translations have been verified\n to be excellent quality. Also, this free mode may break unexpectadly in the future.\n * After the translations are done, you'll get a new folder that is the name of the video with \"test_\" prepended to it. So `myvideo.mp4` will generate a \"text_myvideo\" with srt files for all the languages\n * in the example above, you would get\n * `text_myvideo/en.srt`\n * `text_myvideo/es.srt`\n * `text_myvideo/fr.srt`\n * `text_myvideo/zh.srt`\n * `text_myvideo/it.srt`\n\n\n# How it works\n\n * Translation from audio -> en.srt is performed by `transcribe-anything`\n * Sadly, `transcribe-anything` can only translate to english subtitles.\n * After the english is generated, DeepL is used as a backend service to translate to english to all other languages.\n\n\n# Language Reference\n\n### Language Inputs\n\nWe use openai whisper for language input. See whisper ai documents for a full supported list\n\n\n### Language outputs\n\nWe use the deepl AI for translation. The language list is as follows:\n\n```\n BG - Bulgarian\n CS - Czech\n DA - Danish\n DE - German\n EL - Greek\n EN - English (unspecified variant for backward compatibility; please select EN-GB or EN-US instead)\n EN-GB - English (British)\n EN-US - English (American)\n ES - Spanish\n ET - Estonian\n FI - Finnish\n FR - French\n HU - Hungarian\n ID - Indonesian\n IT - Italian\n JA - Japanese\n KO - Korean\n LT - Lithuanian\n LV - Latvian\n NB - Norwegian (Bokm\u00e5l)\n NL - Dutch\n PL - Polish\n PT-BR - Portuguese (Brazilian)\n PT-PT - Portuguese (all Portuguese varieties excluding Brazilian Portuguese)\n RO - Romanian\n RU - Russian\n SK - Slovak\n SL - Slovenian\n SV - Swedish\n TR - Turkish\n UK - Ukrainian\n ZH - Chinese (simplified)\n```\n\nPlease see [https://www.deepl.com/docs-api/translate-text/](https://www.deepl.com/docs-api/translate-text/) for more information\n\n# Windows\n\nThis environment requires you to use `git-bash`.\n\n# Linting\n\nRun `./lint.sh` to find linting errors using `ruff`, `pylint`, `flake8` and `mypy`.\n\n# Releases\n\n * 1.0.11: Fix macos\n * 1.0.10: Allows app to run when not using hardware acceleration for AI.\n * 1.0.9: Fix settings.json bug in not created directories.\n * 1.0.8: Adds password field and centralizes settings.json under appdirs.\n * 1.0.7: Adds progress bar when doing work.\n * 1.0.6: Adds gui language help for language codes.\n * 1.0.5: Adds webvtt format option.\n * 1.0.4: Adds thread processor so that multiple files can be done one at a time.\n * 1.0.3: Adds gui.\n * 1.0.2: Fix bug.\n * 1.0.1: Adds retry to translation step. Also alerts when the video is done.\n * 1.0.0: Initial release.\n\n\n\n# Future Work\n\n### Text to Speech\n\nIt would be a good idea to convert the subtitles into a spoken track that can be integrates into a video\n\n * Eleven labs API\n * Website: https://beta.elevenlabs.io/\n * Rest API: https://docs.elevenlabs.io/api-reference/text-to-speech-stream\n * Python API: https://github.com/elevenlabs/elevenlabs-python\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "Creates Video Subtitles",
"version": "1.0.11",
"project_urls": {
"Homepage": "https://github.com/zackees/video-subtitles"
},
"split_keywords": [
"template-python-cmd"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b5084d33e89f25617bd80030bb4e6edc87ef20cf08b024796725087b45febfb5",
"md5": "a4dcb81831b699d87f2a6068cadecd21",
"sha256": "e34a7a6496609f9c014c45aed328336d416f9b6950b22763a9b61fd4e519545f"
},
"downloads": -1,
"filename": "video_subtitles-1.0.11-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a4dcb81831b699d87f2a6068cadecd21",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 17235,
"upload_time": "2023-05-19T02:34:47",
"upload_time_iso_8601": "2023-05-19T02:34:47.771208Z",
"url": "https://files.pythonhosted.org/packages/b5/08/4d33e89f25617bd80030bb4e6edc87ef20cf08b024796725087b45febfb5/video_subtitles-1.0.11-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b78061313ef8330e3eac81b56f8aa9e263ca287c65cadce4e1603a436bdb5121",
"md5": "f26ef4ab8e59f71918941f7d79f25ed7",
"sha256": "02c2eb0f681fc423a4c6a665b7f79893036b905c7fa6709924e4d016b289beb7"
},
"downloads": -1,
"filename": "video-subtitles-1.0.11.tar.gz",
"has_sig": false,
"md5_digest": "f26ef4ab8e59f71918941f7d79f25ed7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 334432,
"upload_time": "2023-05-19T02:34:52",
"upload_time_iso_8601": "2023-05-19T02:34:52.155368Z",
"url": "https://files.pythonhosted.org/packages/b7/80/61313ef8330e3eac81b56f8aa9e263ca287c65cadce4e1603a436bdb5121/video-subtitles-1.0.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-19 02:34:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zackees",
"github_project": "video-subtitles",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "video-subtitles"
}