I am working on the following project:

I want a video playing on a raspberry pi continuously in a loop. Whenever I press a button on the gpio, i want a text to be overlayed on the video for 5 seconds and then disappear.

I have seen posts on the internet providing solutions with OpenCV and moviepy but the python program only opens a video from a predefined filepath and displays the text on a predefined frame. What I want is the text to be displayed on demand on playing video.

Could you please suggest any projects or solutions which might suit my needs? Thank you for your time.

1 Answer 1


I would recommend using GStreamer for this.

Check out their tutorials to understand how to play a video file, and this page documents how to apply a text overlay.

You will probably want to test using the gst-launch-1.0 command line tool, but to trigger from a GPIO I expect you'll need to write a program. You can use GStreamer from a wide variety of programming languages, but since you mentioned Python, here's the Python bindings for GStreamer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.