AnsweredAssumed Answered

How to play video in QT?

Question asked by yuantian tang on May 31, 2015

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

Outcomes