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.1.2.tar.gz (9.3 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.1.2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cshortranslate-0.1.2.tar.gz
Algorithm Hash digest
SHA256 96aef79d30d70b3f10b8e0dfad3edff5d23ec988d3503fee22a9fd04655bf987
MD5 af51a392b047f4a3c03be04f25227b43
BLAKE2b-256 249cdaee61aa57d0e68991fc4fc25a553e5dc5a675480f4664e408f14333bd4d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cshortranslate-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.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.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7b7c72dbb1fcc03aa9dea2317336d18993ca825db260a5542fe9ba13f6efb13
MD5 b830aa6e090713c14df2afe832bb0c1f
BLAKE2b-256 4f5403211975072a530202a8c3ffa3d878421409221459dd4dd6d30321db1241

See more details on using hashes here.

Provenance

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