Search code examples
pythonopencvvideosubtitle

How to display text on video from a csv in python


I have a video and a transcript for that video in a csv file. Are there any python tools to show this video while overlaying text from the csv file, like subtitles?

I have used the imshow() tools with OpenCV to overlay text onto webcam feeds, but can that be done with pre-recorded video as well, or is there another, more efficient way to approach this that I am unaware of?


Solution

  • You can use this tutorial from OpenCV docs to play pre-recorded videos from files. To add text, simply use the putText method to apply text to the frame before using imshow() to display it.