Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

How to stream a video frame by frame from sys1 to a qt-application on sys2 and display it in real time, on linux



  • I want to implement GStreamer pipeline using UDP socket and display that video ion QT.
    I am using QT 5.12.9 version.
    I want to run server command in one terminal and client should be in Qt app so it will display video in widgets.
    Server: $gst-launch-1.0 -v filesrc location =<file_path/>video_test.mp4 ! qtdemux ! video/x-h264 ! rtph264pay ! udpsink host=127.0.0.1 port=8000

    client $@client: $gst-launch-1.0 -v udpsrc port=8000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! filesink location=a.mp4

    #include "dialog.h"
    #include <QApplication>
    #include <QMediaPlayer>
    #include <QVideoWidget>
    #include <QDebug>
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        //Dialog w;
        //w.show();
         QMediaPlayer* player =new QMediaPlayer;
         QVideoWidget* vw= new QVideoWidget;
         player->setVideoOutput(vw);
         player->setMedia(QUrl::fromLocalFile("/video_test.mp4"));
         vw->setGeometry(100,100,300,400);
         vw->show();
         player->play();
         qDebug() <<player->state();
         return a.exec();
    }
    
    ``
    
    please any one help me.


  • #include "dialog.h"
    #include <QApplication>
    #include <QMediaPlayer>
    #include <QVideoWidget>
    #include <QDebug>
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        //Dialog w;
        //w.show();
         QMediaPlayer* player =new QMediaPlayer;
         QVideoWidget* vw= new QVideoWidget;
         player->setVideoOutput(vw);
        player->setMedia(QUrl("gst-pipeline: videotestsrc ! autovideosink"));
         vw->setGeometry(100,100,300,400);
         vw->show();
         player->play();
         qDebug() <<player->state();
         return a.exec();
    }
    

    I am trying to integrate the :player->setMedia(QUrl("gst-pipeline: videotestsrc ! autovideosink")); in app but showing me follows error : Error: "No URI handler implemented for "gst-pipeline"."


  • Lifetime Qt Champion

    Hi,

    Are you sure you are using the correct version of Qt to build and run your application ?



  • @SGaist yes QT 5.12.9 version and trying to integrate

    player->setMedia(QUrl("gst-pipeline: videotestsrc ! autovideosink"));
    

  • Lifetime Qt Champion

    How are you running your application ?
    From your error, it looks like you are using an older version of Qt.



  • @SGaist
    I am building my application
    @command line: $qmake
    $make
    $./video_play.
    by following above sequence it shows me blank screen of Qt widgets.
    ** if launch Qt gui from path: $cd qt.5.12.9/Tools/QtCreator/bin
    $ ./qtcreator
    if i press build and run option its shows me error like :
    QMediaPlayer::StoppedState
    Error: "No URI handler implemented for "gst-pipeline"."


  • Lifetime Qt Champion

    @Pooja-Bhusare said in How to stream a video frame by frame from sys1 to a qt-application on sys2 and display it in real time, on linux:

    qmake

    Are you sure you're using the correct qmake here? Use absolute path to qmake from Qt installation you want to use.



  • @jsulm
    $qmake -version
    QMake version 3.1
    Using Qt version 5.12.9 in /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib


  • Lifetime Qt Champion

    What do you get if you call ldd your_application_name ?



  • @SGaist linux-vdso.so.1 => (0x00007ffdebed9000)
    libQt5MultimediaWidgets.so.5 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libQt5MultimediaWidgets.so.5 (0x00007f15c7fc9000)
    libQt5Multimedia.so.5 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libQt5Multimedia.so.5 (0x00007f15c7cbc000)
    libQt5Widgets.so.5 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libQt5Widgets.so.5 (0x00007f15c746d000)
    libQt5Core.so.5 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libQt5Core.so.5 (0x00007f15c6cd2000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f15c6950000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f15c673a000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f15c6370000)
    libQt5Gui.so.5 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libQt5Gui.so.5 (0x00007f15c5b21000)
    libQt5Network.so.5 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libQt5Network.so.5 (0x00007f15c5779000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f15c555c000)
    libpulse-mainloop-glib.so.0 => /usr/lib/x86_64-linux-gnu/libpulse-mainloop-glib.so.0 (0x00007f15c5357000)
    libpulse.so.0 => /usr/lib/x86_64-linux-gnu/libpulse.so.0 (0x00007f15c5107000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f15c4df6000)
    libQt5OpenGL.so.5 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libQt5OpenGL.so.5 (0x00007f15c4b9f000)
    libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f15c492b000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f15c4622000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f15c4408000)
    libicui18n.so.56 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libicui18n.so.56 (0x00007f15c3f6f000)
    libicuuc.so.56 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libicuuc.so.56 (0x00007f15c3bb7000)
    libicudata.so.56 => /<PATH>/QT_5_12_9/5.12.9/gcc_64/lib/libicudata.so.56 (0x00007f15c21d4000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f15c1fd0000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f15c1dce000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f15c81e7000)
    libpulsecommon-8.0.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-8.0.so (0x00007f15c1b51000)
    libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f15c1905000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f15c1695000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f15c146c000)
    libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f15c1269000)
    libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f15c1066000)
    libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f15c0e5f000)
    libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f15c0c5c000)
    libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f15c0a2b000)
    libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f15c0819000)
    libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f15c0616000)
    libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f15c0410000)
    libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f15c020e000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f15bfed4000)
    libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f15bfcbb000)
    libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f15bfab6000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f15bf894000)
    libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f15bf68e000)
    libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f15bf47c000)
    libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f15c834c000)
    libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007f15bf272000)
    libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007f15bf008000)
    libasyncns.so.0 => /usr/lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007f15bee02000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f15bebfa000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f15be9f6000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f15be7f0000)
    libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f15be5ce000)
    liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f15be3ac000)
    libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f15be0cb000)
    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f15bdeb2000)
    libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007f15bdc3d000)
    libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f15bd994000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f15bd779000)
    libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f15bd565000)
    libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f15bd35c000)
    libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f15bd131000)


Log in to reply