I'm trying to capture video from raspberry pi camera using OpenCV and display it without using gtk or x11. I noticed that raspivid displays camera output without using any window, I wonder if it's possible to use the same method to make opencv display video without using gtk.

Edit: I'm using raspbian lite without any desktop environment or GUI services, it's just a tty environment. I don't want to use any of their lightweight counterparts. How can I create a frame to display a picture/video on a tty environment and also use that approach to make OpenCV use it instead of regular windows generated by namedWindow() function?

  • 1
    Now the question is clear, but it seems that what you ask for requires some serious coding, and I wouldn't expect people to write code for you. Commented Sep 3, 2019 at 8:11
  • 1
    So the linux framebuffer is one way to do this; it is accessed via a special device node and an iotctl() based C API. However, glancing at the raspicam/raspivid source I think it uses the VideoCore libraries distributed with the pi: raspberrypi.stackexchange.com/questions/tagged/mmal
    – goldilocks
    Commented Sep 3, 2019 at 13:37
  • 2
    @goldilocks Thanks for your great explanations! A lot of helpful info in 4 lines. Actually the way raspistill uses VideoCore libraries might help me to get to the answer. Instead of creating a window using OpenCV I might be able to feed image data to the mmal component, preview, in order to display image. I will dig in more, you might want to write the answer so that I can approve it. Commented Sep 10, 2019 at 9:13

1 Answer 1


Instead of playing video on command line you can use scp and download recorded video from raspberry pi to your system then you can enjoy your video.

  • 1
    What is sap protocol? The question you answered wasn't asked.
    – Ingo
    Commented Sep 3, 2019 at 17:54
  • 1
  • Well, it's been a while since I posted this. The answer you gave is not particularly the answer to my question, I'm aware of SSH protocol and I know how to use it but what I want is not to watch a video in any possible way, but in a particular way which is through a TTY. As you might guessed, TTY is an environment where user interface does not exist. So the question is: how can a video, which is inherently visual and only available through user interfaces, can be played on a TTY? Commented Aug 1, 2022 at 12:18

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.