PDA

View Full Version : Phonon (or any else) video capture



TimeCoder
12th November 2012, 07:30
Hi!

I need video capture from web-camera (desktop application), under Windows 7 and Linux Mint. How to enumerate devices and run frames loop - I can't find it, and for begin I tryed execute this trivial code:



#include <QtGui/QApplication>
#include <phonon/VideoPlayer>
#include <QLabel>
#include <QUrl>

int main(int argc, char *argv[])
{
QApplication a(argc,argv);
a.setApplicationName("test");
QLabel l;
Phonon::VideoPlayer* player = new Phonon::VideoPlayer(Phonon::VideoCategory,&l);
player->play(QUrl::fromLocalFile("d:\\test.avi"));
l.show();

return a.exec();
}


Under Windows 7 this code doesn't work. Just blank window, no video.
Under Linux Mint this code doesn't compile (after adding QT += phonon in pro-file).

What I am doing wrong? Qt version: 4.8.2

Thank you in advance for your help.

TimeCoder
12th November 2012, 11:58
New details!

After install lpulse-mainloop-glib package in Linux - project can compile! But I see only black window, not video. If open video use Totem Movie Player - correctly showing.

Problem still not solved In Windows..

What a reason can be?