Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QMedia and RTMP Sources
Forum Updated to NodeBB v4.3 + New Features

QMedia and RTMP Sources

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
7 Posts 2 Posters 1.3k 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.
  • erikherzE Offline
    erikherzE Offline
    erikherz
    wrote on last edited by
    #1

    I am looking for a sample project that displays video from a RTMP Stream.
    This project works for a local MP4 but not from a valid RTMP source:

    my .pro file:

    QT       += core gui widgets multimedia multimediawidgets
    TARGET = testApp
    TEMPLATE = app
    SOURCES += main.cpp
    

    My main.cpp file:

    #include <QApplication>
    #include <QMainWindow>
    #include <QVideoWidget>
    #include <QMediaPlayer>
    #include <QMediaPlaylist>
    
    int main(int argc, char * argv[])
    {
    
        QApplication testApp(argc, argv);
        QMainWindow w;
        QVideoWidget videoWidget(&w);
        w.setCentralWidget(&videoWidget);
        QMediaPlayer *player = new QMediaPlayer(&w);
        QMediaPlaylist *playlist = new QMediaPlaylist;
    
        // - THIS WORKS:
        playlist->addMedia(QUrl( QUrl::fromLocalFile("/Users/erik/Desktop/vivoh/movies/jamie.mp4") ));
    
        // - THIS DOES NOT (URL DOES WORK IN VLC)
        //playlist->addMedia(QUrl("rtmp://10.0.0.214/live/stream"));
    
        playlist->setCurrentIndex(1);
        player->setPlaylist(playlist);
        player->setVideoOutput(&videoWidget);
        w.show();
        player->play();
    
        return testApp.exec();
    }
    
    
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What version of Qt are you using ?
      On what OS ?

      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
      • erikherzE Offline
        erikherzE Offline
        erikherz
        wrote on last edited by
        #3

        5.14 on MacOS.
        Screen Shot 2020-03-15 at 3.46.57 PM.png

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

          That is the information about Qt Creator, not the version of Qt you are using to build your application.

          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
          • erikherzE Offline
            erikherzE Offline
            erikherz
            wrote on last edited by erikherz
            #5

            Qt/5.14.1/clang_64

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

              Ok, my bad, I mixed rtmp with another protocol. It seems that AVFoundation does not support it. You might want to use VLC and its Qt integration. It provides a wider range of supported codec and protocols than native APIs.

              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
              1
              • erikherzE Offline
                erikherzE Offline
                erikherz
                wrote on last edited by
                #7

                Roger that. Thank you!

                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