Unsolved How to use a Video Producer to write on frames being displayed?
-
i saw that, but what i need is some sample code. it's not immediately obvious how to hook it up. or rather: it's no obvious after several hours of reading, researching, googling, and trying a dozen things.
-
also, i'm not using QML, so that doesn't apply to me. if it DOES apply, then the structure of that sentence does NOT make that clear.
I miss "Inside Macintosh", the quality of that documentation has never been surpassed.
-
if it helps, here's some code that i have, i just can't figure out how to shoehorn the video producer thing in there:
QGridLayout *layout = new QGridLayout; QTimer *timer = new QTimer(this); //AddSurface<Widget>(this, layout, timer, "Native", columnI++); //AddSurface<GLWidget>(this, layout, timer, "OpenGL", columnI++); #if 1 { #if OPT_MACOS CFileRef movieFile(CFileRef::kFolder_DESKTOP); #else CFileRef movieFile("Z:\\Users\\davec\\Desktop"); #endif ERR(movieFile.GetChild("Movies/test.mp4", &existsB)); if (!err && existsB) { QMediaPlayer *mediaPlayer = new QMediaPlayer(NULL, QMediaPlayer::VideoSurface); QGraphicsVideoItem *videoItem = new QGraphicsVideoItem(); QGraphicsView *graphicsView = new QGraphicsView(new QGraphicsScene(this)); QSizeF vidSize(340, 200); videoItem->setSize(vidSize); #if 0 mediaPlayer->setVideoOutput(videoItem); #else MyVideoSurface *vidSurfaceP = new MyVideoSurface(); MyVideoProducer *vidProducerP = new MyVideoProducer(); vidProducerP->setVideoSurface(vidSurfaceP); QVideoRendererControl *rendererControl = mediaPlayer->requestControl<QVideoRendererControl *>(); rendererControl->setSurface(vidProducerP); // mediaPlayer->setVideoOutput(vidSurfaceP); #endif graphicsView->scene()->addItem(videoItem); SuperString filePath(movieFile.path(true)); QUrl fileUrl(QUrl::fromLocalFile(filePath)); mediaPlayer->setMedia(fileUrl); mediaPlayer->play(); layout->addWidget(graphicsView, 0, columnI++); } } #endif
-
What exactly are you trying to do ? Your code is not really clear on the aspect.
-
just insert the video producer into the chain and have the movie still play. the goal is to be able to write to video frames while the movie is playing (eg: put a graphic badge on it, or draw some text over the movie, like subtitles)
-
Then shouldn't you rather make use of video filters ?
-
my app is C++ Widgets, not QML
-
i think it just needs a wee bit more documentation, or better yet, a sample project? anyone?
-
please does ANYONE know how to use this? is there ANY more doc or sample code on this ?
-