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 Updated to NodeBB v4.3 + New Features

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 last edited by Tejas Virpariya
    #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

    • Login

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