Skip to main content

Tool for extracting hard subtitles from videos.

Project description

rapid_videocr Package

PyPI SemVer2.0

1. Install package by pypi.

pip install rapid_videocr

2. Run by script.

  • RapidVideOCR API

    # __init__
    Args:
       is_concat_rec (bool, optional): Whether to single recognition. Defaults to False.
       concat_batch (int, optional): The batch of concating image nums in concat recognition mode. Defaults to 10.
    
    # __call__
    Args:
         video_sub_finder_dir (Union[str, Path]): RGBImages or TXTImages from VideoSubFinder app.
         save_dir (Union[str, Path]): The directory of saving the srt/txt file.
         out_format (str, optional): Output format of subtitle(srt, txt, all). Defaults to 'all'.
    
    Raises:
        RapidVideOCRError: meet some error.
    
  • Example:

    from rapid_videocr import RapidVideOCR
    
    extractor = RapidVideOCR(is_concat_rec=True, concat_batch=10)
    
    rgb_dir = 'RGBImages'
    save_dir = 'result'
    extractor(video_sub_finder_dir=rgb_dir, save_dir=save_dir, out_format='srt')
    

3. Run by command line.

  • Usage:
    $ rapid_videocr -h
    usage: rapid_videocr [-h] [-i IMG_DIR] [-s SAVE_DIR] [-o {srt,txt,all}]
                        [-m {single,concat}]
    
    optional arguments:
    -h, --help            show this help message and exit
    -i IMG_DIR, --img_dir IMG_DIR
                            The full path of RGBImages or TXTImages.
    -s SAVE_DIR, --save_dir SAVE_DIR
                            The path of saving the recognition result.
    -o {srt,txt,all}, --out_format {srt,txt,all}
                            Output file format. Default is "all".
    -m {single,concat}, --mode {single,concat}
                            Which mode to run (concat recognition or single
                            recognition), default is "single".
    -b CONCAT_BATCH, --concat_batch CONCAT_BATCH
                            The batch of concating image nums in concat
                            recognition mode. Default is 10.
    
  • Example:
    $ rapid_videocr -i RGBImages -s Results -o srt -m concat -b 10
    

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

rapid_videocr-2.1.3-py3-none-any.whl (11.9 kB view hashes)

Uploaded Python 3

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