Skip to main content

Add Automatic Captions to YouTube Shorts with AI

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

captacity_clipify-0.3.2.tar.gz (151.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

captacity_clipify-0.3.2-py3-none-any.whl (151.2 kB view details)

Uploaded Python 3

File details

Details for the file captacity_clipify-0.3.2.tar.gz.

File metadata

  • Download URL: captacity_clipify-0.3.2.tar.gz
  • Upload date:
  • Size: 151.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for captacity_clipify-0.3.2.tar.gz
Algorithm Hash digest
SHA256 71f6c57d3595b0142906b6b122bcb9d0938b32708da1563b399a8fa9d635292f
MD5 3d08af7e244439d5c5d4fb23c7dc38cd
BLAKE2b-256 470eb723885ca58bd7f6ffa4ee3ac5f693750848b30e2d3bf524b8fb88f75205

See more details on using hashes here.

File details

Details for the file captacity_clipify-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for captacity_clipify-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 876f497ec3f7220df3f4644736447ff68beb2762d5c731ddf0913252400b10ee
MD5 8846b63ca08432720ebd8823b0172c28
BLAKE2b-256 eff579c932fcd0b7ec59b4d0c934e945477b5855c377073a35b88b51de899e8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page