Skip to main content

OCR-based subtitle extraction from video files

Project description

cshortranslate

OCR-based subtitle extraction from video files. Designed for extracting Chinese subtitles from long drama videos.

Installation

pip install cshortranslate

Usage

cshortranslate video.mp4
cshortranslate video.mp4 -o output.srt
cshortranslate video.mp4 --fps 15 --region "bottom:20"
cshortranslate video.mp4 --preview

Options

Option Description
-o, --output Output SRT path (default: <video>.srt)
--fps Frame extraction rate (default: 10)
--region Subtitle region: "bottom:15" for bottom 15%, or "x,y,w,h" in pixels
--preview Show first frame with crop overlay for region selection
--backend Video backend: opencv, pyav, ffmpegcv, degirum
--batch-size Frames to OCR in parallel (default: 1)
--num-workers OCR worker threads (default: 1)
--min-chars Minimum characters to keep (default: 2)
--min-dur Minimum duration in seconds (default: 0.3)

Requirements

  • Python 3.9+
  • rapidocr-onnxruntime
  • opencv-python
  • tqdm
  • numpy

License

MIT

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

cshortranslate-0.2.1.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

cshortranslate-0.2.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file cshortranslate-0.2.1.tar.gz.

File metadata

  • Download URL: cshortranslate-0.2.1.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cshortranslate-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b5cdce66bb7eaef86212b7fd9e3a29b1bf3dd99c349df46101d673800c8ac637
MD5 88b12cf251c0b1017924b1be2a763e6c
BLAKE2b-256 b60f7cdf3822409bd255dd2c99a4d79f5fb6fa33564356b89aedda31376da292

See more details on using hashes here.

Provenance

The following attestation bundles were made for cshortranslate-0.2.1.tar.gz:

Publisher: publish.yml on Liiesl/cshortranstale

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cshortranslate-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: cshortranslate-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cshortranslate-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5ff0695e846ea3d49b01cf97630965feebfa4ee03c3b883c4c4331d3aac40b5
MD5 0592a6e50a9b25e216092b665d714808
BLAKE2b-256 33ea1f0598860bdefb126b2f0ad61fef88f1b176a12ec8c695c132d37f674f38

See more details on using hashes here.

Provenance

The following attestation bundles were made for cshortranslate-0.2.1-py3-none-any.whl:

Publisher: publish.yml on Liiesl/cshortranstale

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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