Skip to content

Python script that extracts text from a video using Optical Character Recognition

Notifications You must be signed in to change notification settings

mhamzakhattak/video2text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

video2text

Python script that extracts text from a video using Optical Character Recognition (OCR). It utilizes the OpenCV library for video processing and the pytesseract library for performing OCR.

Requirements

  • Python 3.x
  • OpenCV (pip install opencv-python)
  • pytesseract (pip install pytesseract)

Please note that pytesseract requires the Tesseract OCR engine to be installed on your system. Make sure to install Tesseract OCR using the appropriate method for your operating system.

Usage

  1. Ensure you have the necessary Python libraries installed by running the following command:

pip install -r requirements.txt

  1. Set the path to your input video file and the desired output text file in the script:

Path to the video file

video_path = '/input/path'

Path to the output text file

output_file = '/output/path'

Implement any necessary preprocessing techniques in the preprocess_frame function. This function allows you to resize, denoise, enhance quality, or apply other preprocessing steps to the frame.

Run the script using the following command:

python video_text_extractor.py The extracted text will be saved to the specified output file.

Contributing Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

License This project is licensed under the MIT License.

You can customize and modify the README.md file as per your requirements. Don't forget to include any additional information or instructions that you think would be helpful for users of your script.

About

Python script that extracts text from a video using Optical Character Recognition

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages