Giter Site home page Giter Site logo

captacity's Introduction

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.

captacity's People

Contributors

unconv avatar

Stargazers

 avatar Strange avatar Sarfraz Ahmed avatar Ufoz avatar Mark avatar  avatar Technetium1 avatar Mehmet Emir Yurtoglu avatar  avatar Zoey.C avatar Sushil Kumar avatar  avatar ANASS ELKADI avatar  avatar  avatar  avatar  avatar Sean Hatfield avatar Gourav avatar  avatar Fabio Dias Rollo avatar Nunzio Raciti avatar Mariaria avatar meetog avatar nicekate avatar Tarik Tutuncu avatar huihai avatar  avatar  avatar Ronivaldo Sampaio avatar

Watchers

Kostas Georgiou avatar  avatar  avatar

captacity's Issues

Caption position

Hi!
Thank you for the great work! What do you suggest about positioning the caption. Having caption right at the center is not very ideal for the videos I am experimenting with your project.

NO ISSUE . JUST FOR THANKING

Hello @unconv . I have opened this issue just to thank u for this project . This is awesome . I have been tryin to this for a long time and finally YT recommended me your video .Thanks..

So i am building a service and i am using this package .

Summary ,
Thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.