Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QVideoWidget not showing video

QVideoWidget not showing video

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • musimbateM Offline
    musimbateM Offline
    musimbate
    wrote on last edited by
    #1

    Hi,
    I was playing with QtMultimedia and I thought the next piece of code should show the video

    @

    //VIDEO PLAYING .....

    QMediaPlayer *player = new QMediaPlayer;
    QMediaPlaylist *playlist = new QMediaPlaylist(player);
    playlist->addMedia(QUrl("E:/karamage.avi"));
    playlist->addMedia(QUrl("E:/karamage1.avi"));
    
    QVideoWidget *videoWidget = new QVideoWidget;
    player->setVideoOutput(videoWidget);
    
    playlist->setCurrentIndex(1);
    player->play();
    
    //VIDEO PLAYING ENDS HERE.
    
    //WE DEAL WITH LAYOUTS HERE
    QVBoxLayout * mLayout=new QVBoxLayout();
    mLayout->addWidget(videoWidget);
    setLayout(mLayout);
    
    //LAYOUT HANDLING ENDS HERE.
    

    @

    But when I run the application ,I simply see an empty widget .I feel I missed sth and I would appreciate it if you helped me point it out.I apologize if this is obvious.(I am jut getting started with Multimedia programming) .

    My setup: Windows8.1/ Qt 5.2 / VS2012

    Thanks for your time.

    Why join the navy if you can be a pirate?-Steve Jobs

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Check the console output, it might be some missing codecs (avi is only a container and can have many things in it)

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved