Extract subtitles from video using opencv.通过opencv图片识别方法抽取视频中的文字,字幕。

git@yoqi.me e7eb33c0c0 update by server 6 months ago
assets 9f1b1a6fd6 init 4 years ago
tools-ocr 21b2edaa1b 完事,接口限制。多次执行会出错。 4 years ago
.gitignore 9f1b1a6fd6 init 4 years ago
OcrUtils.py 9f1b1a6fd6 init 4 years ago
README.md 3e33303552 增加 en 3 years ago
README_CN.md e7eb33c0c0 update by server 6 months ago
main.py 9f1b1a6fd6 init 4 years ago
pre_do.py 9f1b1a6fd6 init 4 years ago
requirements.txt 9f1b1a6fd6 init 4 years ago
user_agent.py 9f1b1a6fd6 init 4 years ago

README.md

video-subtitle-extract

videos extract subtitles. The project includes python (video processing) and java (picture to text) source.

Introduction

This tool mainly serves companies such as news media and self-media. Implemented the following functions:

Position the subtitles in the video,

Use the Natural Language Recognition function to extract the subtitle text in the video.

Usage

  1. Put the video file in the videos folder.

  2. First execute the pre_do.py file to check the video frame rate, video size and other information.

  3. Through the previous operation, modify the parameters in main.py so that the subtitle pictures are intercepted well. Then executing main.py will generate subtitle pictures (10 sentences combined into one picture for easy identification) in the videos folder after analyzing the video.

  4. Execute MainFm.java to perform batch text recognition on the above pictures (call Baidu/Sogou and other text recognition free interfaces respectively). The obtained results are saved in the project resxxx.txt file.

Note

Due to the text recognition interface, the recognition may be wrong. So you can execute it a few times and compare the results.

Copyright

mail: liuyuqi.gov@msn.cn