PDA

View Full Version : QMediaPlayer: MP4 file with AAC audio format



ollerei
12th February 2013, 02:07
Hi,

I'm trying to use QMediaplayer, which is based on Qt 5.0.1, to program a simple video player. The source video file is a mp4 file, which is consist of MEPG-4 format video and AAC format audio.

The code is like this:


player= new QMediaPlayer(this);
videoWidget = new QVideoWidget(this);
player->setVideoOutput(videoWidget);
this->setCentralWidget(videoWidget);
player->setMedia(QUrl::fromLocalFile("D:/YoutubeDownload/testvideo.mp4"));
player->setVolume(100);
player->play();

If I run this code, the video is running ok, but no sound. I think that it could be due to the AAC audio format.

How can I change the code in order to let QMediaPlayer play mp4 file with AAC audio format?

Thanks!

Added after 18 minutes:

This testvideo MP4 file plays without problems on my VLC player

Talei
12th February 2013, 03:51
This is related to the missing codec for the AAC audio format.
Check if in Your native OS Media player audio plays correctly. Don't use VLC as they use codec that are OS independent and will play (probably - depending on the installed codec) more or same amount of the codec.