Giter Club home page Giter Club logo

rapidvideocr's Introduction


简体中文 | English

PyPI SemVer2.0

目录

简介

  • 视频硬字幕提取,自动生成对应srt | txt文件。
  • 支持字幕语言:中文 | 英文 (其他可以支持的语言参见:支持语种列表)
  • 可加入QQ群:706807542
  • 更快更准确地提取视频硬字幕,并提供srt| txtl两种格式的输出:
    • 更快:与VideoSubFinder软件结合使用,提取关键字幕帧更快。
    • 更准:采用RapidOCR作为识别库。
    • 更方便:pip直接安装即可使用。
  • **该工具处于发展中。在使用过程中,如果遇到任何问题,欢迎提issue或者入群反馈。
  • 如果不愿意用的话,不用就好,不要影响自己心情。**
  • 如果有帮助到您的话,请给个小星星⭐或者赞助一杯咖啡(点击页面最上面的Sponser中链接)。

TODO

  • 增加对VideoSubFinder软件提取字幕帧结果的处理接口
  • 尝试将VideoSubFinder核心功能整合到本项目中,通过其开放的CLI mode

整体框架

flowchart LR
    A(VideoSubFinder) --提取字幕关键帧--> B(RapidVideOCR)  --OCR--> C(SRT)
Loading

更新日志(more

🎈2023-03-02 v2.0.5~7 update:

  • 修复生成的srt文件中的格式错误, #19

🎫2023-02-17 v2.0.4 update:

  • 针对传入的TXTImages目录,作了优化处理。相比于传入RGBImages,会更快和更准。推荐传入TXTImages目录

使用步骤

  1. 安装使用VideoSubFinder软件
  2. 安装rapid_videocr
    pip install rapid_videocr
  3. 使用RapidVideOCR工具
    • 脚本运行:
      from rapid_videocr import RapidVideOCR
      
      extractor = RapidVideOCR()
      
      rgb_dir = 'test_files/TXTImages'
      save_dir = 'result'
      extractor(rgb_dir, save_dir)
    • 命令行运行:
      • Usage:
        $ rapid_videocr -h
        usage: rapid_videocr [-h] [-i IMG_DIR] [-s SAVE_DIR] [-o {srt,txt,all}]
        
        optional arguments:
        -h, --help            show this help message and exit
        -i IMG_DIR, --img_dir IMG_DIR
                                The full path of mp4 video.
        -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"
      • Example:
        $ rapid_videocr -i RGBImages -s Results -o srt
  4. 查看结果
    • 前往save_dir目录下即可查看结果。
    • 值得注意的是,如果想要让视频播放软件自动挂载srt文件,需要更改srt文件名字为视频文件名字,且放到同一目录下,亦或者手动指定加载。

写在最后

  • 扫码加入组织:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.