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. play .mp4 file in Qt creator
Forum Updated to NodeBB v4.3 + New Features

play .mp4 file in Qt creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.1k Views 1 Watching
  • 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.
  • P Offline
    P Offline
    Pooja Bhusare
    wrote on last edited by
    #1

    Re: How to play .mp4
    Hello,

    I am using qt creator version
    $qmake --version
    =>Using Qt version 5.5.1

    I have installed all gstreamer module
    and able to play .mp4 using $gst-play & $gst-launch command also

    while running on Qt creator output window get open but its not playing anything.
    output logs :
    =>QMediaPlayer::PlayingState
    Warning: "No decoder available for type 'video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)high, codec_data=(buffer)01640028ffe1001967640028acd100780227e5c04400000fa40003a9803c60c44801000468ebef2c, max-input-size=(int)116703, width=(int)1920, height=(int)1080, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1'."
    Warning: "No decoder available for type 'audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1210, max-input-size=(int)558, rate=(int)44100, channels=(int)2'."
    Error: "Your GStreamer installation is missing a plug-in.

    main.cpp
    =>#include "dialog.h"
    #include <QApplication>
    #include <QMediaPlayer>
    #include <QVideoWidget>
    #include <QDebug>

    int main(int argc, char argv[])
    {
    QApplication a(argc, argv);
    QMediaPlayer
    player =new QMediaPlayer;
    QVideoWidget* vw= new QVideoWidget;
    player->setVideoOutput(vw);
    player->setMedia(QUrl::fromLocalFile("samplevideo.mp4"));
    vw->setGeometry(100,100,300,400);
    vw->show();
    player->play();
    qDebug() <<player->state();
    return a.exec();
    }

    .pro file

    QT += core gui multimedia multimediawidgets
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TARGET = video_play_file
    TEMPLATE = app
    SOURCES += main.cpp
    dialog.cpp
    HEADERS += dialog.h

    please verfiy my code.

    Pablo J. RoginaP 1 Reply Last reply
    0
    • P Pooja Bhusare

      Re: How to play .mp4
      Hello,

      I am using qt creator version
      $qmake --version
      =>Using Qt version 5.5.1

      I have installed all gstreamer module
      and able to play .mp4 using $gst-play & $gst-launch command also

      while running on Qt creator output window get open but its not playing anything.
      output logs :
      =>QMediaPlayer::PlayingState
      Warning: "No decoder available for type 'video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)4, profile=(string)high, codec_data=(buffer)01640028ffe1001967640028acd100780227e5c04400000fa40003a9803c60c44801000468ebef2c, max-input-size=(int)116703, width=(int)1920, height=(int)1080, framerate=(fraction)30000/1001, pixel-aspect-ratio=(fraction)1/1'."
      Warning: "No decoder available for type 'audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1210, max-input-size=(int)558, rate=(int)44100, channels=(int)2'."
      Error: "Your GStreamer installation is missing a plug-in.

      main.cpp
      =>#include "dialog.h"
      #include <QApplication>
      #include <QMediaPlayer>
      #include <QVideoWidget>
      #include <QDebug>

      int main(int argc, char argv[])
      {
      QApplication a(argc, argv);
      QMediaPlayer
      player =new QMediaPlayer;
      QVideoWidget* vw= new QVideoWidget;
      player->setVideoOutput(vw);
      player->setMedia(QUrl::fromLocalFile("samplevideo.mp4"));
      vw->setGeometry(100,100,300,400);
      vw->show();
      player->play();
      qDebug() <<player->state();
      return a.exec();
      }

      .pro file

      QT += core gui multimedia multimediawidgets
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      TARGET = video_play_file
      TEMPLATE = app
      SOURCES += main.cpp
      dialog.cpp
      HEADERS += dialog.h

      please verfiy my code.

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @Pooja-Bhusare said in play .mp4 file in Qt creator:

      please verfiy my code.

      well, instead of verifying your code, you may need to verify your installation... see:

      Warning: "No decoder available for type 'audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1210, max-input-size=(int)558, rate=(int)44100, channels=(int)2'."

      Error: "Your GStreamer installation is missing a plug-in.

      From Qt Multimedia documentation:

      The Qt Multimedia APIs build upon the multimedia framework of the underlying platform. This can mean that support for various codecs or containers can vary between machines, depending on what the end user has installed.

      As a side note,

      I am using qt creator version
      $qmake --version
      =>Using Qt version 5.5.1

      You may need to differentiate between Qt Creator (the IDE) and Qt framework, the libraries.
      You're showing the version of your Qt framework in use.
      For getting the Qt Creator version, Help -> About ...

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      jsulmJ 1 Reply Last reply
      2
      • Pablo J. RoginaP Pablo J. Rogina

        @Pooja-Bhusare said in play .mp4 file in Qt creator:

        please verfiy my code.

        well, instead of verifying your code, you may need to verify your installation... see:

        Warning: "No decoder available for type 'audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1210, max-input-size=(int)558, rate=(int)44100, channels=(int)2'."

        Error: "Your GStreamer installation is missing a plug-in.

        From Qt Multimedia documentation:

        The Qt Multimedia APIs build upon the multimedia framework of the underlying platform. This can mean that support for various codecs or containers can vary between machines, depending on what the end user has installed.

        As a side note,

        I am using qt creator version
        $qmake --version
        =>Using Qt version 5.5.1

        You may need to differentiate between Qt Creator (the IDE) and Qt framework, the libraries.
        You're showing the version of your Qt framework in use.
        For getting the Qt Creator version, Help -> About ...

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Pablo-J-Rogina said in play .mp4 file in Qt creator:

        For getting the Qt Creator version, Help -> About ...

        First time I see it other way around :-) Usually people post what "Help -> About ..." says when asked about Qt version :-)

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1

        • Login

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