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.0.tar.gz (18.0 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.0-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cshortranslate-0.2.0.tar.gz
  • Upload date:
  • Size: 18.0 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.0.tar.gz
Algorithm Hash digest
SHA256 5669da2a01b4b56bafb5bd41b2a2ecab1d39bc5162bba119959c4af9a275c241
MD5 d076fef9d1d49e12c461ecf913751c1a
BLAKE2b-256 e45550dc95a510ad2db2bcd46c803f3fe59a5b81d7f772c249e9925e7e4bcfb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for cshortranslate-0.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: cshortranslate-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 636e69d0475f5319f2c3c74e7e70ebd523eaac75c272567e99270c90803a9996
MD5 6bd389bf7134629a6e255f0d409b2a5e
BLAKE2b-256 504a4d4205b5427ece60d71b6c7664b57027b36a3129a9a831b552495248a8a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for cshortranslate-0.2.0-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