I am trying to write subtitles on a video. The problem is , with cv2(opencv-python), I am unable to write text on different time frames , lets say for first two seconds I want "Hello", and for another 3 seconds the video will show "this is the introduction" and so on.
My question is, how can I achieve this with opencv-python. The thing why I want to use cv2 only is it creates an object for that video and do not create a new file, and that is important for my project.
If you guys have any idea how we can write subtitles on a video without creating another file, please do let me know.
I also tried ffmpeg it worked absolutely fine for me and I used a .srt file for that, but again it was creating a new file and same happened with moviepy library so in any case if you could show me a way how can we overwrite the file in ffmpeg or moviepy, it would be very helpful.
THANKS.