QMediaPlayer MP4 H264
-
Windows 7 & 8.
QT 5.4.
Kit (chain) MSVC2013_64 & MSVC2013_64_opengl.
Source code:
@
#include <QApplication>
#include <QWidget>
#include <QMediaPlayer>
#include <QVBoxLayout>
#include <QVideoWidget>int main(int argc, char **argv)
{
QApplication app(argc, argv);QWidget *widget = new QWidget; widget->resize(400, 300); QVBoxLayout *layout = new QVBoxLayout; QMediaPlayer *player = new QMediaPlayer; QVideoWidget *vw = new QVideoWidget; layout->addWidget(vw); widget->setLayout(layout); player->setVideoOutput(vw); player->setMedia(QUrl::fromLocalFile("testVideo.mp4")); player->setVolume(50); player->play(); widget->show(); qDebug() << "mediaStatus: " << player->mediaStatus() << "error: " << player->error(); return app.exec();
}
@
Deployed:
“
Directory di E:\godzilla\build4vs\bin\Debug
test_video.exeDirectory di E:\godzilla\build4vs\bin\Debug
icudt53.dll
icuin53.dll
icuuc53.dll
libeay32.dll
libEGLd.dll
libGLESv2d.dll
msvcp120.dll
msvcp120d.dll
msvcr120.dll
msvcr120d.dll
NPSWF64_14_0_0_179.dll
PDFNetC.dll
Qt5Cored.dll
Qt5Declaratived.dll
Qt5Guid.dll
Qt5Multimediad.dll
Qt5MultimediaWidgetsd.dll
Qt5Networkd.dll
Qt5OpenGLd.dll
Qt5Positioningd.dll
Qt5PrintSupportd.dll
Qt5Qmld.dll
Qt5Quickd.dll
Qt5Scriptd.dll
Qt5Sensorsd.dll
Qt5Sqld.dll
Qt5Svgd.dll
Qt5Testd.dll
Qt5WebChanneld.dll
Qt5Webkitd.dll
Qt5WebkitWidgetsd.dll
Qt5Widgetsd.dll
Qt5Xmld.dll
Qt5XmlPatternsd.dll
ssleay32.dll
vcamp120.dll
vcamp120d.dll
vccorlib120.dll
vccorlib120d.dll
vcomp120.dll
vcomp120d.dll
zlibd.dllDirectory di E:\godzilla\build4vs\bin\Debug\audio
qtaudio_windowsd.dllDirectory di E:\godzilla\build4vs\bin\Debug\imageformats
qjpegd.dllDirectory di E:\godzilla\build4vs\bin\Debug\mediaservice
dsengined.dll
qtmedia_audioengined.dll
wmfengined.dllDirectory di E:\godzilla\build4vs\bin\Debug\platforms
qwindowsd.dllDirectory di E:\godzilla\build4vs\bin\Debug\printsupport
windowsprintersupportd.dllDirectory di E:\godzilla\build4vs\bin\Debug\qtwebengine
ffmpegsumo.dllDirectory di E:\godzilla\build4vs\bin\Debug\sqldrivers
qsqlited.dll
“
2 MP4 files.
1:
“
1 video H264 High-4.1, 81.320 secs, 670 kbps, 800x600 - 25.000000 fps
2 audio MPEG-4 AAC LC, 81.365 secs, 0 kbps, 48000 Hz
3 audio ac-3, 81.344 secs, 224 kbps, 48000 Hz
Encoded with: HandBrake 0.10.0 2014112200
“
2:
“
1 video H264 Main-4, 299.880 secs, 1226 kbps, 1280x720 - 25.000000 fps
2 audio MPEG-4 AAC LC, 299.925 secs, 0 kbps, 48000 Hz
Encoded with: HandBrake 0.10.0 2014112200
“
Both files are readed by Windows Media Player.
File 2: is readed by the QT application.
File 1: is NOT readed by the QT application.I need help, thanks.