How to play video in QT?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to play video in QT?

1,345 Views
yuantiantang
Contributor I

environment:

IMX6Q,

LTIB 3.0.35.410 BSP with gstreamer-0.10

QT5.3.2 with qtmultimedia module and gstreamer-0.10 as backend

Everything is cross-compiled OK. gst-launch and gplay are working well too.

But in QT5.3.2, I use qtmultimedia module to play video which will call gstreamer, audio is working, but video is not.

I didn't see any video at all. The console outputs many VPU information as well as audio. That means VPU is called.

The code is pretty like the following:

player = new QMediaPlayer(this);

QGraphicsVideoItem *item = new QGraphicsVideoItem;

player->setVideoOutput(item);

graphicsView->scene()->addItem(item);

graphicsView->show();

player->setMedia(QUrl("http://example.com/myclip4.ogv"));

player->play();

so my questions are:

1. how to play video in QT5.3.2?

2. Is there any working code snip or other way that I can try to play video in QT? No matter what QT version are OK. 

Thanks in advance,

Hasson

Labels (3)
0 Kudos
Reply
0 Replies