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[])
{
a.setApplicationName("test");
Phonon::VideoPlayer* player = new Phonon::VideoPlayer(Phonon::VideoCategory,&l);
player
->play
(QUrl::fromLocalFile("d:\\test.avi"));
l.show();
return a.exec();
}
#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();
}
To copy to clipboard, switch view to plain text mode
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.
Bookmarks