Skip to content

how do I import a video? #86

Answered by robertknight
Raj2032 asked this question in Q&A
Discussion options

You must be logged in to vote

To process a video you will need to:

  1. Find a way to extract frames from the video as an image. I am not that familiar with the state of video processing in Rust, but a wrapper for GStreamer, FFmpeg or OpenCV might be a starting point (eg. the VideoCapture APIs)
  2. Convert the image to 8-bit RGB, if not already in that format
  3. Use ocrs::ImageSource::from_bytes to prepare the image for Ocrs to process.
  4. Once you have an ImageSource, you can then feed it into text recognition following the steps in the example.

To speed up extraction, you will probably want to sample only a subset of the frames. For example, extract only 1 in every N frames.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Raj2032
Comment options

Answer selected by Raj2032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants