Skip to main content

Transcribes video/audio/url to subtitles.

Project description

video2sub

video2sub is a command-line tool that transcribes video/audio/url to subtitles. It supports various subtitle formats such as txt, srt, vtt, tsv, and json. The tool uses speech recognition models from whisper to perform transcription.

Requirements

Python 3.8+
ffmpeg

Installation

Install ffmpeg.

(Optional) Install CUDA & cuDNN. You can either install them system wide or create a conda environment using environment.yml.

Install pipx.

Install video2sub using pipx:

pipx install video2sub --include-deps

(Optional) Copy config.vide2sub.example.yml to ~/.config/ (win %UserProfile%\.config) then rename it to config.video2sub.yml. Edit it to your prefer default value.

Usage

video2sub [video_url] [--lang] [--model] [--proxy] [--output] [--verbose] [--force]
Argument Description
video_url The URL of the video or path of the video/audio file.
--lang The language code of the audio file to be transcribed. Default: "en".
--model The name/path to the speech recognition model to be used for transcription. Default: "small".
--proxy Proxy to be used for downloading the video from url.
--output Output format: txt, vtt, srt, tsv, json. Default: "txt".
--verbose Show output.
--force Force to retrieve then transcribe video regardless of existing audio or subtitle file.

Note: If the --lang or --model arguments are not specified, the tool will use the default values which can be set by the user in the configuration file ~/.config/video2txt.yml.

Examples

  1. Transcribe a video from a URL using default config:

    video2sub https://www.youtube.com/watch?v=dQw4w9WgXcQ
    
  2. Transcribe a video from a English spoken video file using medium model and save it as a .vtt subtitle:

    video2sub my_video.mp4 --lang en --model medium --output vtt
    
  3. Transcribe an audio file and save it as a .srt subtitle:

    video2sub my_audio.mp3 --output srt
    

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

video2sub-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

video2sub-0.1.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file video2sub-0.1.1.tar.gz.

File metadata

  • Download URL: video2sub-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.4 Linux/5.19.0-38-generic

File hashes

Hashes for video2sub-0.1.1.tar.gz
Algorithm Hash digest
SHA256 202cf0f06c437e4cf184710e678704f5fd564b646665c4fcc3c76490466d5639
MD5 58d8a77a91b3ce351ec37eaeae93a112
BLAKE2b-256 300b9b97a8c03a217dd71060f6ec9e05917743124a4a0d760d760c279061e2ef

See more details on using hashes here.

File details

Details for the file video2sub-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: video2sub-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.4 Linux/5.19.0-38-generic

File hashes

Hashes for video2sub-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d579886c256aa82014cc1e4ec0efbe0b0d1f5f3eade817964af38b7b8e744b9d
MD5 8a254d7465e1159abecfed6212f1cb11
BLAKE2b-256 f82e82c1f0c1ab0b2f1e973cc74da351b6f427bc55200a98e37623bc4534cb1e

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