Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to display RTSP Stream using QT?
Forum Update on Monday, May 27th 2025

How to display RTSP Stream using QT?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 2.1k 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.
  • T Offline
    T Offline
    Tejas Virpariya
    wrote on 4 Mar 2016, 06:41 last edited by Tejas Virpariya 3 Jul 2016, 07:11
    #1

    I am totally new for RTSP technology... If I have url like rtsp://localhost:8080/xyz.sdp, then how can I access this url in QT application?

    I have a code from old Qt forum:

    // Sample code to play rtsp stream on qt widgets

    int main(int argc, char *argv[])
    {
          gst_init (&argc, &argv);
          QApplication app(argc, argv);
          app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit ()));
    
          // prepare the pipeline
          GstElement *pipeline = gst_parse_launch ("playbin uri=rtsp://172.19.91.21/channel.sdp", NULL);
    
          // prepare the ui
          QWidget window;
          window.setWindowTitle("MyWidget");
          window.resize(640, 480);
          window.show();
    
          WId xwinid = window.winId();
          //this is the call to overlay the gstreamer's output to the Qt Widgets...
          gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (pipeline), xwinid);
    
    
          // run the pipeline
          GstStateChangeReturn sret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
          if (sret == GST_STATE_CHANGE_FAILURE)
          {
            gst_element_set_state (pipeline, GST_STATE_NULL);
            gst_object_unref (pipeline);
            // Exit application
            QTimer::singleShot(0, QApplication::activeWindow(), SLOT(quit()));
          }
    
          int ret = app.exec();
    
          window.hide();
          gst_element_set_state (pipeline, GST_STATE_NULL);
          gst_object_unref (pipeline);
    
          return ret;
    }
    

    But I don't know how to use this. What I have to pass in arguments? and How can I pass argument in this code? means I want full detail to use this code, which other .cpp files will use? which type of data in header file and .pro file? everything.

    I got data from : https://forum.qt.io/topic/59758/how-to-display-rtsp-stream-using-qt-i-already-used-libvlc-qt-for-display-but-i-didn-t-get-control-over-stream-after-using-this-library-so-i-don-t-want-to-use-libvlc-qt/2

    -Thanks
    Tejas Patel

    1 Reply Last reply
    0

    1/1

    4 Mar 2016, 06:41

    • Login

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