Skip to main content

A Python package (+CLI) for voice over subtitles, with the ability to embed in video, audio ducking, and dynamic voice changer for a single track.

Project description

Package for voice over subtitles:

  • with the ability to embed in video,
  • audio ducking,
  • dynamic voice changer for a single track. Add "!: voice name" at the beginning of the subtitle line. (Applies to all subsequent ones)

pip install -U PyFastDub

python -m FastDub --help

CLI

usage: FastDub [-h] -i INPUT [INPUT ...] [-vf VIDEO_FORMAT] [-sf SUBTITLES_FORMAT] [-En EXCLUDE [EXCLUDE ...]] [-Eu EXCLUDE_UNDERSCORE]
               [-sc | --sidechain | --no-sidechain] [-sc-msl MIN_SILENCE_LEN] [-sc-st SILENCE_THRESH] [-sc-gdo GAIN_DURING_OVERLAY]
               [-v {microsoft irina desktop - russian,microsoft zira desktop - english united states),microsoft david desktop - english (united sta
tes,yuriy}]
               [-a ALIGN] [-ll LOGLEVEL] [-y | --confirm | --no-confirm] [-rf CLEANUP_LEVEL] [-rc]

FastDub is a tool for dubbing videos by subtitle files.

options:
  -h, --help            show this help message and exit
  -rf CLEANUP_LEVEL, --cleanup-level CLEANUP_LEVEL
                        Cleanup level   0 = No removing any files
                                > 0 remove audio from video (default)
                                > 1 = remove dubbed audio if video exists
                                > 2 = reomve dubbed cache files
  -rc, --remove-cache   Remove all cache files

Input:
  -i INPUT [INPUT ...], --input INPUT [INPUT ...]
                        Input directory.
  -vf VIDEO_FORMAT, --video-format VIDEO_FORMAT
                        Video format (default .mp4).
  -sf SUBTITLES_FORMAT, --subtitles-format SUBTITLES_FORMAT
                        Subtitles format (default .srt).

Audio Ducking:
  -sc, --sidechain, --no-sidechain
                        Enable audio side chain compress (ducking) (default: True)
  -sc-msl MIN_SILENCE_LEN, --min-silence-len MIN_SILENCE_LEN, --attack MIN_SILENCE_LEN
                        Minimum silence length in ms (default 100)
  -sc-st SILENCE_THRESH, --silence-thresh SILENCE_THRESH
                        Silence threshold in dB
  -sc-gdo GAIN_DURING_OVERLAY, --gain-during-overlay GAIN_DURING_OVERLAY
                        Gain during overlay in dB

Voicer:
  -v {microsoft irina desktop - russian,microsoft zira desktop - english (united states),microsoft david desktop - english (united states),yuriy}, 
--voice {microsoft irina desktop - russian,microsoft zira desktop - english (united states),microsoft david desktop - english (united states),yuriy
}
                        Voice
  -a ALIGN, --align ALIGN
                        Audio fit align
                                1 = right
                                2 = center (default)

FFMpeg Output:
  -ll LOGLEVEL, --loglevel LOGLEVEL
                        FFMpegWrapper loglevel
  -y, --confirm, --no-confirm
                        Don't ask for confirmation (default: True)

If the voice set after !: is not selected during voiceover, clear the cache with the -rc argument

Example

python -m FastDub -i "DirToDub" -v "Yuriy" --no-ducking --min-silence-len 200

name = "Any name"

DirToDub:

  • name.srt
  • name.mp4
  • name2.srt
  • name2.mp4

Then: name and name2 will be announced, and the results will be saved to a folder with the appropriate name.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

PyFastDub-2.2.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file PyFastDub-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: PyFastDub-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for PyFastDub-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f3fb27953e69d43d85be41a2d777688e3ecf908eccc5b0db27b5f25b9c5f129
MD5 7c0c300d0347969b510683b77c68a0d3
BLAKE2b-256 2a613285b7af6e2b750085e51c5b22397bc7bf7f26df2ae2e7506b41b5c9e469

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