Java – Is it possible to extract text from video programmatically


I know we can extract text from image using ocr. But I need to extract the text present in video, like those in video lectures. Or in other words is it possible to transcribe a video to text. Is that possible? If so please suggest me how to do it in java or any other language.

Best Solution

My naive linux driven approach would be:

  • check: does the OCR work in my operating system?
  • extract some samples from the video using the normal runner. Each runner (for example VLC) has such a functionality.
  • check: how good is the OCR in extracting text from image files?
  • check: how good is the OCR in extracting text from image files with the background the video is providing?
  • get software to extract frames from videos in batch -> there is various software which allows to create contact-sheets, this should also be able to extract images in full resolution at abitrary points in time out of the video. Full resolution might be necessary to allow the OCR to work. Perhaps you can clip the images first, if you know, that the text is positioned in fixed rectangles.
  • Worst case you let OCR analyse each frame of the movie.

That mostly depends on how good and how fast your OCR is working. Everything else to me is very proven software. The language might be bash-shell-script, since the components will probably be separate linux programs. As I mentioned, it depends on the quality, performance and runtime environment of your OCR.