-2

I want to use a library to showing pictures and videos in my C++ program running on an ARM-based board with Ubuntu-server.

So I am looking for a way to minimise CPU consumption and memory needed, but I don't know how much difference is there between using OpenCV or GTK+ or Qt for this purpose?

Edit:

My goal is a simple and light way to showing images and videos. I mean I want write a C++ code that I can call a function to showing image and a function to showing video (in Ubuntu-server). This is my goal.

peterh
  • 9,488
  • 16
  • 59
  • 88
user3486308
  • 609
  • 3
  • 16
  • 36
  • 1
    Even with the edit, your question remains unclear. On what screen is the video displayed? On what computer is that screen plugged? What display server is involved? What video resolution do you want? So consider improving your question again. – Basile Starynkevitch Oct 26 '17 at 10:28
  • @BasileStarynkevitch: OK, I will do it soon. I have a 2.2" SPI LCD that I should change it to my default screen(but I don't know how and I am searching for it). Also I installed xorg and openbox on my NanoPi-M1 board with Ubuntu-server 16.04 – user3486308 Oct 26 '17 at 16:24

2 Answers2

3

GTK and Qt are frameworks for creating GUIs. OpenCV, on the other hand, is "an open source computer vision and machine learning software library." (quoted from their About section). So you may want to be a bit more specific than that.

schaiba
  • 7,493
  • 1
  • 33
  • 31
3

I want to use a library to showing pictures and videos in my C++ program running on an ARM-based board with Ubuntu-server.

Your question is very unclear. What screen will show the picture. What kind of ARM board is it (Raspberry Pi ?)? Does the ARM board has some LCD screen plugged into its HDMI connector? From where is the video stream coming from? What standard are you using (H264 ?) ?

If the ARM board is server-like without any direct connection to a screen, I would consider running some HTTP server code on it (perhaps using some HTTP server library like libonion). Then you don't need GTK or OpenCV on it. You'll use some web browser. You need to understand the HTTP protocol and HTML5 at least.

If some screen is directly connected (thru an HDMI or DVI cable) to the ARM board, you need to decide what display server is using it (some X11 server, or Wayland ?). BTW, it could happen that your hardware is not powerful enough to display videos on a large (somehow high-resolution) screen.

Before choosing GTk+, OpenCV, Qt read at least the wikipages describing them first. Then read their documentation. At last choose whatever is appropriate.

You should become more familiar with Linux (and that takes several months). I recommend installing some Linux distribution on your usual (desktop or laptop) computer, and reading ALP. Take time to code some toy application using GTK (and another one using Qt, and perhaps another one using OpenCV - which is probably inappropriate for your needs).

Basile Starynkevitch
  • 10,411
  • 1
  • 32
  • 52
  • Here is my detailed question: https://unix.stackexchange.com/questions/400096/how-to-create-a-lite-graphical-ability-for-linux-server – user3486308 Oct 26 '17 at 09:47
  • 1
    Which was closed as too broad... So you need to be even more specific. I strongly recommend installing and using some Linux distribution on your laptop or desktop PC to become more familiar with Linux. You are lacking skills and knowledge, and **you need to learn more**, and spend several months in learning stuff. – Basile Starynkevitch Oct 26 '17 at 09:49
  • I used Linux for a year and know about it, but how does it's graphic works, I don't know about it! Also I know OpenCV and worked a little with Qt before, but again the problem is about how the graphics in Linux work! – user3486308 Oct 26 '17 at 10:05
  • 1
    Then you just need to read about X11, Wayland, Qt, GTK. And graphics layers (on Linux or on other operating systems) are very complex, and video displaying is also complex. – Basile Starynkevitch Oct 26 '17 at 10:29
  • So if there are no simple libraries to include and simple functions to call for showing image and video, isn't it good to using something like OpenCV? I know there is simple function to doing it on OpenCV! – user3486308 Oct 26 '17 at 18:44