An open API service indexing awesome lists of open source software.

https://github.com/SWHL/RapidVideOCR

🎦 Extract video hard subtitles and automatically generate corresponding srt files.
https://github.com/SWHL/RapidVideOCR

ocr subtitle video videosubfinder

Last synced: 3 months ago
JSON representation

🎦 Extract video hard subtitles and automatically generate corresponding srt files.

Awesome Lists containing this project

README

          


 





PyPI


SemVer2.0

[简体中文](https://github.com/SWHL/RapidVideOCR/blob/main/docs/README_zh.md) | English

### Introduction

- Video hard subtitle extraction, automatically generate the corresponding `srt | ass | txt` file.
- Supported subtitle languages: Chinese | English (For other supported languages, see: [List of supported languages](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_ch/multi_languages.md#%E8%AF%AD%E7%A7%8D%E7%BC%A9%E5%86%99))
- The advantages are as follows:
- **Faster extraction**: Used in conjunction with [VideoSubFinder](https://sourceforge.net/projects/videosubfinder/) software to extract key subtitle frames faster.
- **More accurate recognition**: Use [RapidOCR](https://github.com/RapidAI/RapidOCR) as the recognition library.
- **More convenient to use**: pip can be installed directly and used.

- For desktop EXE version, please go to [RapidVideOCRDesktop](https://github.com/SWHL/RapidVideOCRDesktop).
- If it helps you, please give a star ⭐.

### [Online Demo](https://huggingface.co/spaces/SWHL/RapidVideOCR)


Demo

### Overall framework

```mermaid
flowchart LR
A[/Video/] --Extract subtitle key frame--> B(VideoSubFinder) --OCR-->C(RapidVideOCR)
C --Convert--> D[/"SRT | ASS | TXT"/]
```

### Installation

```bash
pip install rapid_videocr
```

### Usage

> [!NOTE]
>
> The input image path of `rapid_videocr` must be the path of **RGBImages** or **TXTImages** output by **VideoSubFinder** software.

```bash
rapid_videocr -i RGBImages
```

or python script:

```python
from rapid_videocr import RapidVideOCR, RapidVideOCRInput

input_args = RapidVideOCRInput(is_batch_rec=False)
extractor = RapidVideOCR(input_args)

rgb_dir = "tests/test_files/RGBImages"
save_dir = "outputs"
save_name = "a"

# outputs/a.srt outputs/a.ass outputs/a.txt
extractor(rgb_dir, save_dir, save_name=save_name)
```

### Documentation

Full documentation can be found on [docs](https://swhl.github.io/RapidVideOCR/docs), in Chinese.

### Code Contributors





### Contributing

- Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.
- Please make sure to update tests as appropriate.

### [Sponsor](https://swhl.github.io/RapidVideOCR/docs/sponsor/)

If you want to sponsor the project, you can directly click the **Buy me a coffee** image, please write a note (e.g. your github account name) to facilitate adding to the sponsorship list below.



### License

This project is released under the [Apache 2.0 license](./LICENSE).