July 11, 2011

xcoder xcoder
Lab Rat
45 posts

Phonon snapshot problems

 

Hello everybody,

I am able to capture a frame using grabWindow method

  1. QPixmap bilde = QPixmap::grabWindow(videoPlayer->videoWidget()->winId());

How can I use built in phonon snapshot function? All I get is that picture size is 0×0 px.

  1. QImage bilde;
  2.  bilde = videoPlayer->videoWidget()->snapshot();
  3.    
  4.     qDebug()<<"Bildes izmers:" << bilde.size();
  5.     if (bilde.size().isEmpty())
  6.     {
  7.  qDebug()<<"Mainigaja bilde, nav datu!";
  8.     }
  9.     else
  10.     {
  11.       bool saved = bilde.save("snap.jpg", "JPG", 100);
  12.       qDebug() << "Vai saglabaja?" << saved;
  13.     }

I want to try VideoWidget::snapshot, because my video feed is 1080×720px, but my videoPlayer widget is 720×480px and I want to capture full sized video frame, with grabWindow method I only can save picture with the same size as the widget.

Is there a method to capture full size video frame with grabWindow method?
Why VideoWidget::snapshot function isn’t working?

I’m using kubuntu 11.04 with Qt 4.7.2 and C++

Best Regards
Raivis

 Signature 

Only a biker knows why a dog sticks his head out of a car window.

5 replies

September 16, 2011

Burt Burt
Lab Rat
3 posts

I had the same problem and submitted a Nokia-Qt tech support query. I heard back today with the following response:

>>>>>
I was able to reproduce your problem but unfortunately I cannot provide a workaround for this. I have reported a new Qt bug about this issue: QTBUG-21491. You can follow it via link:
https://bugreports.qt.nokia.com/browse/QTBUG-21491
<<<<<

Looks like it cannot be done in Qt as of 4.7.4…

September 17, 2011

peppe peppe
Ant Farmer
1025 posts

I would not expect it to be fixed by Nokia.

Did you try with the phonon version inside KDE?

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

September 19, 2011

Burt Burt
Lab Rat
3 posts

I am curious why you believe Nokia will not fix this?

I have not built the Phonon KDE myself, but reading online threads on the issue includes comments from others that have tried, and say that it does not fix the problem.

This is such a fundamental and “always used” feature that it amazes me that it could have been overlooked, or is not a high priority to fix. Have you ever seen a video library representation that did not include a thumbnail view of the clips (at least as an option)?

September 20, 2011

peppe peppe
Ant Farmer
1025 posts

Because yes. Phonon in Qt is old and bugged, and won’t be developed by Nokia any more. Use the one from KDE.

References:
1) http://labs.qt.nokia.com/2011/05/12/qt-modules-maturity-level-the-list/
2) git log src/3rdparty/phonon
3) https://bugreports.qt.nokia.com/secure/IssueNavigator.jspa?reset=true&jqlQuery=(summary+~+phonon+OR+description+~+phonon)+AND+status+in+(Open,+“In+Progress”)

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

September 20, 2011

Burt Burt
Lab Rat
3 posts

While I can write competent C++ and Qt front-end code, I am not really very skilled at playing around with compilers and libraries and making them jump through hoops.

I am not able to find any direct instructions for how to take something from the KDE site and updating my Qt installation with it. I tried just installing the KDE Windows stuff, but the phonon stuff is then in dll/pdb files rather than the lib files that Qt expects (for the first level of problem anyway).

Google is failing me (which is rare…). Do you happen to know of any source for such instructions? (the KDE user forum is pretty close to useless)

 
  ‹‹ Slot return value - what if it would be not lost?      Real-time Audio Processing with Qt ››

You must log in to post a reply. Not a member yet? Register here!