Skip to main content

Captacity

Add automatic captions to YouTube Shorts (and other videos) using Whisper and MoviePy

Quick start

$ pip install captacity
$ captacity <video_file> <output_file>

Programmatic use

import captacity

captacity.add_captions(
    video_file="my_short.mp4",
    output_file="my_short_with_captions.mp4",
)

Custom configuration

import captacity

captacity.add_captions(
    video_file="my_short.mp4",
    output_file="my_short_with_captions.mp4",

    font = "/path/to/your/font.ttf",
    font_size = 130,
    font_color = "yellow",

    stroke_width = 3,
    stroke_color = "black",

    shadow_strength = 1.0,
    shadow_blur = 0.1,

    highlight_current_word = True,
    word_highlight_color = "red",

    line_count=1,

    padding = 50,
)

Using Whisper locally

By default, OpenAI Whisper is used locally if the openai-whisper package is installed. Otherwise, the OpenAI Whisper API is used. If you want to force the use of the API, you can specify use_local_whisper=False in the arguments to captacity.add_captions:

import captacity

captacity.add_captions(
    video_file="my_short.mp4",
    output_file="my_short_with_captions.mp4",
    use_local_whisper=False,
)

You can install Captacity with pip install captacity[local_whisper] to install Whisper locally as well.

Metadata

Release files for captacity-clipify 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for captacity-clipify 0.3.4
File Size Uploaded
captacity_clipify-0.3.4.tar.gz 151.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for captacity-clipify 0.3.4
File Interpreter ABI Platform
captacity_clipify-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 302.6 kB

Release files / captacity_clipify-0.3.4.tar.gz

Download URL captacity_clipify-0.3.4.tar.gz
Size 151.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ba66648046f32342674d4e59361b9b5ea7a6b7b45df67d97f757bb6e862f5cc8
BLAKE2b-256 checksum
How to use checksums
d598074109be12cd5e41088d19bb64716ec94abdf1fae541473fe5ff00d3c319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.0

Release files / captacity_clipify-0.3.4-py3-none-any.whl

Download URL captacity_clipify-0.3.4-py3-none-any.whl
Size 151.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e5fe64e45abca3d64ad9e2c2951d4bde3437d0eb1532671e3b4d3bbd6eebb0d
BLAKE2b-256 checksum
How to use checksums
c3f97b91f12a121336cae7ef63620d9ba596deb419da67b8631128c9db2b3883
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page