PDA

View Full Version : Problem rendering QImage from Phonon Widget



JimDaniel
10th July 2008, 05:16
//create an image the size of the Phonon::VideoWidget
QImage video_image(phonon_widget->size(), QImage::Format_RGB32);

//render the widget image onto the QImage
phonon_widget->render(&video_image);

video_image.save("c:/test.jpg");



Does anyone know why this wouldn't work? I save this image and all I get is a gray box. I've tried the same procedure with other widgets and it works perfectly. I found some forum posts on the subject, but they weren't any help really. There is video on the screen playing. I've tried pausing it before I render. I've tried using grabWidget(), to no avail.

I feel it's probably something simple I'm not considering...please help me if you can...Daniel

JuanC
12th July 2008, 12:03
I am also interesting on how to save a frame into QImage.

JimDaniel
12th July 2008, 16:31
We've pretty much narrowed our problem down to the way phonon interacts with directshow on windows. We think the widget never actually contains the video image, but that directshow tells the graphics card where to draw on the screen directly. Could be wrong, but that's how it seems.

Because of this I'm working on an audio-video class of my own that uses the ffmpeg API and libavcodec . When I am done, I'll post the class here so that others can use it. It will be able to do anything phonon can at present + more + be cross-platform.