[Qt-interest] Bad video framerate when rendering in a QGraphicsScene

Niklas Berglund niklas.berglund at gmail.com
Sat Mar 21 00:34:04 CET 2009


Hello
I've set up a MediaObject inside a QGraphicsScene.
The reason for this is that I might want to display text over the  
video later.
Maybe there's another way to do this?

Anyways the video playback is really laggy. I'm not opening a high res  
movie or anything like that.
I'm on Mac OS X.

I'm pasting my code below, but its also available highlighted at

	// set up graphics view and scene housing video output
	QGraphicsScene *scene = new QGraphicsScene();
	QGraphicsView *view = new QGraphicsView(scene);
	view->setViewport(new QGLWidget); // for optimization

	// set up media object
	media = new Phonon::MediaObject();

	// set up video
	videoWidget = new Phonon::VideoWidget();
	Phonon::createPath(media, videoWidget);
	view->showFullScreen();
	//videoWidget->setFullScreen(true);
	scene->addWidget(videoWidget);

	// set up audio
	audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory);
	Phonon::createPath(media, audioOutput);

	media->setCurrentSource(QString("/Users/niklas/Movies/test.mov"));
	media->play();

	scene->addLine(50,50,700,700,QPen());


Any ideas on how to solve this? If not - is there another way to  
display text over the video?

/Niklas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090321/f846af16/attachment.html 


More information about the Qt-interest-old mailing list