Skip to main content

Add TikTok-style captions to videos

Project description

TikTok Captions

Add TikTok-style captions to your videos automatically using OpenAI's Whisper for transcription.

Installation

pip install tiktokcaptions

Usage

from tiktokcaptions import add_captions_to_videofile

# whisper transcription (dict)
transcription = ...

# Basic usage
add_captions_to_videofile("input.mp4", transcription=transcription, output_file="with_captions.mp4")

# With custom options
add_captions_to_videofile(
    "input.mp4",
    transcription=transcription,
    output_file="with_captions.mp4",

    # Font settings
    font="Montserrat-ExtraBold.ttf",  # or path to custom font
    font_size=70,
    font_color="white",

    # Stroke settings
    stroke_width=2,
    stroke_color="black",

    # Word highlighting
    highlight_current_word=True,
    highlight_color="#FF4500",
    highlight_padding=(10, 8),  # (x, y) padding
    highlight_radius=10,

    # Layout
    line_count=2,
    padding=50,
    position="center",  # "top", "bottom", or "center"
    margin=0,

    # Shadow effects
    shadow_strength=1.0,
    shadow_blur=0.3,

    # Other
    verbose=False
)

Features

  • Automatic speech recognition using Whisper
  • Customizable caption styling
  • Support for multiple video formats
  • Easy to use API

Requirements

  • Python 3.7+
  • FFmpeg installed on your system

License

MIT License - see LICENSE file for details.

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

tiktokcaptions-0.1.0.tar.gz (239.4 kB view details)

Uploaded Source

Built Distribution

tiktokcaptions-0.1.0-py3-none-any.whl (239.2 kB view details)

Uploaded Python 3

File details

Details for the file tiktokcaptions-0.1.0.tar.gz.

File metadata

  • Download URL: tiktokcaptions-0.1.0.tar.gz
  • Upload date:
  • Size: 239.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for tiktokcaptions-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dce49592c8c8ec7b5116985aeba88f0e6a7929e62f4e83f8d9aa6c52696a7e33
MD5 67cf3beccf083a12823690248aeac6e6
BLAKE2b-256 f3a692e751e37c9f17c1cc15779423f048de426c1373a0f2d6a95d295399b783

See more details on using hashes here.

File details

Details for the file tiktokcaptions-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tiktokcaptions-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29d66eced3e6122f37d2e8147f475dc7cac583c328f1ae928ebb36955bfc04e9
MD5 d1a7f4402f6bd07aebfee5a658d2e296
BLAKE2b-256 2c15f23ee4b1dac6e48579f026eeeb416cf425c9d551071b42b32e65154a7b91

See more details on using hashes here.

Supported by

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