Skip to main content

No project description provided

Project description

stenocaptioner

PyPI - Python Version Downloads

Automatic subtitling tool using whisper.

Dependencies

Installation

Ubuntu

sudo apt-get -y install imagemagick fonts-vlgothic

You will also need to modify the ImageMagick configuration file to comment out the following policy.

sudo vi /etc/ImageMagick-6/policy.xml
  <!--
  <policy domain="path" pattern="@*" rights="none">
  -->

Install with pip.

pip install stenocaptioner

Usage

You can give the url of youtube video as an argument.

stenocaptioner https://www.youtube.com/watch?v=ldybnuFxdiQ --language ja

Options

stenocaptioner --help
usage: stenocaptioner [-h] [--language LANGUAGE] [--model-type {tiny,base,small,medium,large}] [--text-color TEXT_COLOR] [--background-color BACKGROUND_COLOR]
                      [--contour-color CONTOUR_COLOR] [--contour-width CONTOUR_WIDTH] [--font FONT] [--fontsize FONTSIZE] [--fadein-duration FADEIN_DURATION]
                      [--fadeout-duration FADEOUT_DURATION] [--save-text] [--load-text LOAD_TEXT] [--letter-effect {none,typing,arrive,cascade}] [--side-margin SIDE_MARGIN]
                      [--bottom-margin BOTTOM_MARGIN]
                      url

positional arguments:
  url                   URL of the video.

options:
  -h, --help            show this help message and exit
  --language LANGUAGE   Language of the text.
  --model-type {tiny,base,small,medium,large}
                        Whisper model type.
  --text-color TEXT_COLOR
                        Color of the text.
  --background-color BACKGROUND_COLOR
                        Color of the background.
  --contour-color CONTOUR_COLOR
                        Color of the contour.
  --contour-width CONTOUR_WIDTH
                        Width of the contour.
  --font FONT           Font name.
  --fontsize FONTSIZE   Font size.
  --fadein-duration FADEIN_DURATION
                        Duration of the fade-in effect.
  --fadeout-duration FADEOUT_DURATION
                        Duration of the fade-out effect.
  --save-text           Save the transcribed text.
  --load-text LOAD_TEXT
                        Load the transcribed text.
  --letter-effect {none,typing,arrive,cascade}
                        Effect of the letters.
  --side-margin SIDE_MARGIN
                        Margin of the text from the side of the video. It is expressed as a ratio of the width of the image.
  --bottom-margin BOTTOM_MARGIN
                        Margin of the text from the bottom of the video. It is expressed as a ratio of the height of the image.

Original video

demo_org

Basic Result

result_basic

Background color

stenocaptioner https://www.youtube.com/watch?v=ldybnuFxdiQ --language ja --background-color blue

result_bg_color_blue

Contour

stenocaptioner https://www.youtube.com/watch?v=ldybnuFxdiQ --language ja --contour-color black

result_contour

Font

Download https://fontfree.me/3132.

stenocaptioner https://www.youtube.com/watch?v=ldybnuFxdiQ --language ja --font ./gomarice_mukasi_mukasi.ttf

result_font

Effect (typing)

stenocaptioner https://www.youtube.com/watch?v=ldybnuFxdiQ --language ja --letter-effect typing

result_typing

Effect (arrive)

stenocaptioner https://www.youtube.com/watch?v=ldybnuFxdiQ --language ja --letter-effect arrive

result_arrive

Effect (cascade)

stenocaptioner https://www.youtube.com/watch?v=ldybnuFxdiQ --language ja --letter-effect cascade

result_cascade

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

stenocaptioner-0.3.2.tar.gz (6.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: stenocaptioner-0.3.2.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for stenocaptioner-0.3.2.tar.gz
Algorithm Hash digest
SHA256 c8de7477211616531f924a4d41e7e08b65611fc50515cf76e5f85cda62dcc845
MD5 415423ffc172bd8f4d4fc195d34bef67
BLAKE2b-256 7f12403b04c1ec32d182c9ff13b25a6370f0e4328b8686eea4b5355317e7db1d

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