Giter VIP home page Giter VIP logo

rapidvideocr's Introduction


简体中文 | English

PyPI

目录

简介

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

TODO

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

整体框架

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

更新日志(more

🎇2023-02-12 v2.0.1 update:

  • 修复视频时长大于1个小时,字幕帧时间变为0的bug.

使用步骤

  1. 安装使用VideoSubFinder软件
  2. 使用该软件抽取关键字幕帧图像 → 得到RGBImages目录。一般会在软件安装目录下。
  3. 安装rapid_videocr
    pip install rapid_videocr -i https://pypi.douban.com/simple/
  4. 使用RapidVideOCR工具
    • 脚本运行:
      from rapid_videocr import RapidVideOCR
      
      extractor = RapidVideOCR()
      
      rgb_dir = 'test_files/RGBImages'
      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
  5. 查看结果
    • 前往save_dir目录下即可查看结果。
    • 值得注意的是,如果想要让视频播放软件自动挂载srt文件,需要更改srt文件名字为视频文件名字,且放到同一目录下,亦或者手动指定加载。

写在最后

rapidvideocr's People

Contributors

swhl avatar dausruddin avatar

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.