# `vid2captionsai`
`vid2captionsai` is a Python-based tool designed to prepare videos for use with [captions.ai](https://www.captions.ai/), a platform focused on generating captions for audio and video content.
[captions.ai](https://www.captions.ai/) allows you to burn nice animated “hard subtitles” into your video. You upload the video and you get the same video but with the subtitles burned in.
But what if you’d prefer to have some control? `vid2captionsai` offers two commands that help you get just the subtitles, as a separate video with transparency (without your original video content). You can then import that new video into your video editor, overlay it on top of your original video, scale, trim, edit, and have the subtitles rendered on top of your original video the way you want it.
## Installation
Ensure that Python 3.10 or higher is installed on your system, and run:
```bash
python3 -m pip install --upgrade git+https://github.com/twardoch/vid2captionsai
```
## Usage
After installation, `vid2captionsai` can be used via the command line. It has two commands:
### `blank`: Create a blank video
Run the `blank` command:
```bash
vid2captionsai blank /path/to/your/video.mp4 -c 000000 -w 2160 -h 720
```
This creates a blank video with the same duration as your original video, and the original sound, but the video track contains a plain background with the specified color (default: black) and specified dimensions (default: 2160x720).
The video will be saved in the same folder as your original video, but with the suffix `-blank.mp4`.
Then upload that video to the [captions.ai](https://www.captions.ai/) web or desktop app, and generate the subtitles. Download the generated file and place it into the same folder as your original video, with the same name but with the suffix `-subs.mp4`.
More info on the `blank` command:
```
SYNOPSIS
vid2captionsai blank INPUT_PATH <flags>
POSITIONAL ARGUMENTS
INPUT_PATH
Type: str | pathlib.Path
FLAGS
-c, --color=COLOR
Type: str
Default: '000000'
-w, --width=WIDTH
Type: int
Default: 2160
-h, --height=HEIGHT
Type: int
Default: 720
```
### `mask`: Change color to transparent
Once you have your `video-subs.mp4` video, run the tool again with the `mask` command:
```bash
vid2captionsai mask /path/to/your/video.mp4 -c 000000 -t 0.01 -f 6 -o /path/to/your/video-mask.mov
```
This will create a new video where the specified color will be replaced with full transparency and similar colors within the specified tolerance `-t` will be semi-transparent. The video is saved in the Apple ProRes 4444 codec in the MOV format, which supports alpha transparency.
The video track will contain just the subtitles produced by captions.ai. Note: =the video won’t have sound (I may add an option in future to keep it).
Since the background color is transparent, you can import this video into your video editor and overlay it on top of your original content.
More info about the `mask` command:
```
SYNOPSIS
vid2captionsai mask INPUT_PATH <flags>
POSITIONAL ARGUMENTS
INPUT_PATH
Type: str | pathlib.Path
FLAGS
-c, --color=COLOR
Type: str
Default: '000000'
-t, --tolerance=TOLERANCE
Type: float
Default: 0.01
-f, --fps=FPS
Type: Optional[int | None]
Default: None
-o, --output_path=OUTPUT_PATH
Type: Optional[str | pathlib...
Default: None
```
## Credits & License
- `vid2captionsai` © 2023 Adam Twardoch
- Published under the [Apache-2.0](https://github.com/twardoch/vid2captionsai/blob/main/LICENSE.txt) license
Raw data
{
"_id": null,
"home_page": "https://pypi.org/project/vid2captionsai/",
"name": "vid2captionsai",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Adam Twardoch",
"author_email": "adam+github@twardoch.com",
"download_url": "https://files.pythonhosted.org/packages/a9/dd/7eaafeaee9414ff42294c64620106a298fcd905138dd4581c0ac01764969/vid2captionsai-1.0.2.tar.gz",
"platform": "any",
"description": "# `vid2captionsai`\n\n`vid2captionsai` is a Python-based tool designed to prepare videos for use with [captions.ai](https://www.captions.ai/), a platform focused on generating captions for audio and video content. \n\n[captions.ai](https://www.captions.ai/) allows you to burn nice animated \u201chard subtitles\u201d into your video. You upload the video and you get the same video but with the subtitles burned in. \n\nBut what if you\u2019d prefer to have some control? `vid2captionsai` offers two commands that help you get just the subtitles, as a separate video with transparency (without your original video content). You can then import that new video into your video editor, overlay it on top of your original video, scale, trim, edit, and have the subtitles rendered on top of your original video the way you want it. \n \n## Installation\n\nEnsure that Python 3.10 or higher is installed on your system, and run: \n\n```bash\npython3 -m pip install --upgrade git+https://github.com/twardoch/vid2captionsai\n```\n\n## Usage\n\nAfter installation, `vid2captionsai` can be used via the command line. It has two commands: \n\n### `blank`: Create a blank video\n\nRun the `blank` command: \n\n```bash\nvid2captionsai blank /path/to/your/video.mp4 -c 000000 -w 2160 -h 720\n``` \n\nThis creates a blank video with the same duration as your original video, and the original sound, but the video track contains a plain background with the specified color (default: black) and specified dimensions (default: 2160x720).\n\nThe video will be saved in the same folder as your original video, but with the suffix `-blank.mp4`.\n\nThen upload that video to the [captions.ai](https://www.captions.ai/) web or desktop app, and generate the subtitles. Download the generated file and place it into the same folder as your original video, with the same name but with the suffix `-subs.mp4`.\n\nMore info on the `blank` command: \n\n```\nSYNOPSIS\n vid2captionsai blank INPUT_PATH <flags>\n\nPOSITIONAL ARGUMENTS\n INPUT_PATH\n Type: str | pathlib.Path\n\nFLAGS\n -c, --color=COLOR\n Type: str\n Default: '000000'\n -w, --width=WIDTH\n Type: int\n Default: 2160\n -h, --height=HEIGHT\n Type: int\n Default: 720\n```\n\n### `mask`: Change color to transparent\n\nOnce you have your `video-subs.mp4` video, run the tool again with the `mask` command: \n\n```bash\nvid2captionsai mask /path/to/your/video.mp4 -c 000000 -t 0.01 -f 6 -o /path/to/your/video-mask.mov\n```\n\nThis will create a new video where the specified color will be replaced with full transparency and similar colors within the specified tolerance `-t` will be semi-transparent. The video is saved in the Apple ProRes 4444 codec in the MOV format, which supports alpha transparency. \n\nThe video track will contain just the subtitles produced by captions.ai. Note: =the video won\u2019t have sound (I may add an option in future to keep it). \n\nSince the background color is transparent, you can import this video into your video editor and overlay it on top of your original content. \n\nMore info about the `mask` command:\n\n```\nSYNOPSIS\n vid2captionsai mask INPUT_PATH <flags>\n\nPOSITIONAL ARGUMENTS\n INPUT_PATH\n Type: str | pathlib.Path\n\nFLAGS\n -c, --color=COLOR\n Type: str\n Default: '000000'\n -t, --tolerance=TOLERANCE\n Type: float\n Default: 0.01\n -f, --fps=FPS\n Type: Optional[int | None]\n Default: None\n -o, --output_path=OUTPUT_PATH\n Type: Optional[str | pathlib...\n Default: None\n```\n\n## Credits & License\n\n- `vid2captionsai` \u00a9 2023 Adam Twardoch\n- Published under the [Apache-2.0](https://github.com/twardoch/vid2captionsai/blob/main/LICENSE.txt) license\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Tool for preparing videos for use with https://www.captions.ai/",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://pypi.org/project/vid2captionsai/",
"Source": "https://github.com/twardoch/vid2captionsai"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "10d30e547cc8749c957bd8bb7bed0905e4712a15572b1df18d8d83ffd1855a5c",
"md5": "0c354bc08768de64472a08bab3155ec0",
"sha256": "ea623866ae91e10680d7789d64dc8fd2ab2163404a1514f2938874e1903f3aeb"
},
"downloads": -1,
"filename": "vid2captionsai-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0c354bc08768de64472a08bab3155ec0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9546,
"upload_time": "2023-12-12T18:51:25",
"upload_time_iso_8601": "2023-12-12T18:51:25.732465Z",
"url": "https://files.pythonhosted.org/packages/10/d3/0e547cc8749c957bd8bb7bed0905e4712a15572b1df18d8d83ffd1855a5c/vid2captionsai-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a9dd7eaafeaee9414ff42294c64620106a298fcd905138dd4581c0ac01764969",
"md5": "c13377b5f20ac3c742b47a18ecb91548",
"sha256": "6b6b844539d4cbde68294f55c943611f890488b7f9e60c6212d1e80eef38f062"
},
"downloads": -1,
"filename": "vid2captionsai-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "c13377b5f20ac3c742b47a18ecb91548",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11641,
"upload_time": "2023-12-12T18:51:27",
"upload_time_iso_8601": "2023-12-12T18:51:27.411223Z",
"url": "https://files.pythonhosted.org/packages/a9/dd/7eaafeaee9414ff42294c64620106a298fcd905138dd4581c0ac01764969/vid2captionsai-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-12 18:51:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "twardoch",
"github_project": "vid2captionsai",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "vid2captionsai"
}