[Qt-interest] help with QtMultimedia

Dmytro Poplavskiy dmytro.poplavskiy at nokia.com
Wed Jul 21 05:06:40 CEST 2010


Hello Anders,

On Wednesday 21 July 2010 07:59:51 ext Anders Bakken wrote:
> Apologies if this has been answered before but I couldn't find it by
> grep'ing through the archives.
> 
> There seems not to be a whole lot of examples regarding QtMultimedia:
> 
> I have the following use case:
> 
> I want to process live video coming in (in MP4 format but I can possibly
> change that) on a stream and I want to access the raw data of each
> decoded frame to do some analysis. E.g. in RGBA or YUV or whichever
> format it comes.
> 
> Are there APIs in QtMultimedia that could facilitate this kind of
> operation? Are there any examples?

It's possible to get access to video frames without displaying them using
QVideoRendererControl.

You have to implement QAbstractVideoSurface (which returns the list of
video formats you support and receives the video frames) 
and pass it to QVideoRendererControl::setSurface().

The media player backend will pass the video frames to your surface with
QAbstractVideoSurface::present().

We don't have the good example for this case yet, QGraphicsVideoItem and 
QVideoWidget  do this, but because of their complexity it's not the best 
example.

The code may look like this:

QVideoRendererControl* rendererControl = 
      player->service()->requestControl<QVideoRendererControl*>();

if (rendererControl)
    rendererControl->setSurface(surface);

player->setMedia(...); //stream uri
player->play();

Regards
  Dmytro.

> 
> It kinda seems like QVideoFrame would fit nicely into what I want to do
> but I am confused as to how to get from MP4 data to one of those.
> 
> regards
> --
> Anders Bakken
> 
> This message, including attachments, is intended solely for the addressee
> indicated in this message and is strictly confidential or otherwise
> privileged. If you are not the intended recipient (or responsible for
> delivery of the message to such person) : - (1) please immediately (i)
> notify the sender by reply email and (ii) delete this message and
> attachments, - (2) any use, copy or dissemination of this transmission is
> strictly prohibited. If you or your employer does not consent to Internet
> email messages of this kind, please advise Myriad Group AG by reply e-mail
> immediately. Opinions, conclusions and other information expressed in this
> message are not given or endorsed by Myriad Group AG unless otherwise
> indicated by an authorized representative independent of this message.
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list