Results 1 to 7 of 7

Thread: Not able to play Videos with QMediaPlayer and QVideoWiget in Qt 5.2

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2010
    Posts
    44
    Thanks
    9
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Not able to play Videos with QMediaPlayer and QVideoWiget in Qt 5.2

    Hi,

    I have been trying to play video formats *.wmv, *.mp4 with QMediaPlayer and QVideoWidget in Qt5.2. I just followed the expample and here is my code:

    Qt Code:
    1. mp =new QMediaPlayer(this);
    2. vw = new QVideoWidget(this);
    3. QMediaPlaylist* playlist = new QMediaPlaylist(this);
    4. playlist->addMedia(QUrl::fromLocalFile("C:/Users/Public/Videos/Sample Videos/Wildlife.wmv"));
    5. playlist->setCurrentIndex(1);
    6. mp->setPlaylist(playlist);
    7. mp->setVideoOutput(vw);
    8. setGeometry(100,100,400,500);
    9. vw->setGeometry(0,0,300,400);
    10. show();
    11. play();
    To copy to clipboard, switch view to plain text mode 

    I have installed the K-Lite codecs. When I play the same files using Media Player Classic or Win Media Player the files play well and the the Lca and FFmpeg icons show up in the tray.

    But with Qt 5.2 I am not able to see any visuals for any video file. Only for wmv files I am able to hear audio(no visual).

    I have searched a lot on the web and everybody points to codecs which I believe I have. Does the configuration of the K-Lite codecs matter? I have used the default codecs. I have built Qt with the Win media foundation too. So I am at a loss to understand what is wrong here. Platform is win7 32.
    Any help is appreciated. Do let me know if I have to reading anything or any article or blog. Thank you.

  2. #2
    Join Date
    Mar 2010
    Posts
    86
    Thanks
    11
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Not able to play Videos with QMediaPlayer and QVideoWiget in Qt 5.2

    The question is what compiler with Qt 5.2.1 are you using? Opening just .AVI video? you're using MinGW. Opening other formats, use VS2012.
    I have mine doing .MOV, .AVI, .MP4 working with VS2012 64 bit and 32 bit. While .AVI working with MinGW.
    think your issue is that the VS2012 and VS2010 have DirectX Support, while I believe that MinGW doesn't.
    Have to say out of the box video without Phonon manual configuring is nice.
    oh I use Qt 5.2.0 Windows 8.1 haven't tried it in Ubuntu or Mac land yet
    Last edited by budda; 30th January 2014 at 16:31.

  3. #3
    Join Date
    Dec 2010
    Posts
    44
    Thanks
    9
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Not able to play Videos with QMediaPlayer and QVideoWiget in Qt 5.2

    Hi Budda,

    Thanks for the reply.
    The compiler is MSVC++ 2010. I have been using the same platform, same compiler, codecs with 4.8.5. And it works all well.
    Now I am trying to move to Qt5.2. And I am facing this problem. The problem is with all formats. Only with wmv files I am able to hear the audio.

    Sky.

Similar Threads

  1. Mediaplayer Youtube videos
    By madrich in forum Qt Programming
    Replies: 0
    Last Post: 6th March 2013, 14:28
  2. [Tab play list]Load play lists on start
    By petrusPL in forum Qt Programming
    Replies: 0
    Last Post: 18th March 2011, 18:12
  3. How to play youtube videos in Symbian device
    By prajnaranjan.das in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 2nd February 2011, 12:45
  4. How to play various media formats in Qmediaplayer
    By S P in forum Qt Programming
    Replies: 0
    Last Post: 1st June 2010, 13:28
  5. Qt::WA_TranslucentBackground and videos headache.
    By Smokex in forum Qt Programming
    Replies: 0
    Last Post: 17th March 2010, 18:40

Tags for this Thread

Bookmarks

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.