Results 1 to 2 of 2

Thread: QMediaPlayer: MP4 file with AAC audio format

  1. #1
    Join Date
    May 2011
    Qt products
    Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows

    Default Re: QMediaPlayer: MP4 file with AAC audio format


    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:

    Qt Code:
    1. player= new QMediaPlayer(this);
    2. videoWidget = new QVideoWidget(this);
    3. player->setVideoOutput(videoWidget);
    4. this->setCentralWidget(videoWidget);
    5. player->setMedia(QUrl::fromLocalFile("D:/YoutubeDownload/testvideo.mp4"));
    6. player->setVolume(100);
    7. player->play();
    To copy to clipboard, switch view to plain text mode 

    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?


    Added after 18 minutes:

    This testvideo MP4 file plays without problems on my VLC player
    Last edited by ollerei; 12th February 2013 at 01:07.

  2. #2
    Join Date
    Dec 2008
    Thanked 42 Times in 42 Posts
    Qt products
    MacOS X Unix/X11 Windows Android

    Default Re: QMediaPlayer: MP4 file with AAC audio format

    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.
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

Similar Threads

  1. Replies: 1
    Last Post: 26th November 2012, 19:09
  2. Replies: 5
    Last Post: 1st June 2011, 08:28
  3. What are the types of video and audio file format Qt simulator supports
    By prajnaranjan.das in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 16th May 2011, 10:34
  4. How to read RAW audio file ?
    By fitzy in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2010, 13:37
  5. Replies: 0
    Last Post: 21st July 2010, 10:32

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.