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. Displaying rtsp stream with gstreamer on qt - android
Forum Updated to NodeBB v4.3 + New Features

Displaying rtsp stream with gstreamer on qt - android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 293 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.
  • K Offline
    K Offline
    kuroro-l
    wrote on 17 Oct 2024, 12:36 last edited by
    #1

    This is my pipeline:

    Gstreamer_camera_capture::Gstreamer_camera_capture(std::string camera)
    {
        std::string pipeline_str = "rtspsrc location=" + camera + " latency=0 ! rtpjitterbuffer latency=10 ! rtph264depay ! avdec_h264 ! videoconvert ! video/x-raw,format=RGB ! appsink name=app_sink sync=false";
    
    
        this->_pipeline = gst_parse_launch(pipeline_str.c_str(), NULL);
    
        // Get app sink part of pipeline
        this->_app_sink = gst_bin_get_by_name(GST_BIN(_pipeline), "app_sink");
    
        g_object_set(this->_app_sink, "emit-signals", TRUE, NULL);
        g_signal_connect(this->_app_sink, "new-sample", G_CALLBACK(new_sample), this);
    
        // Start playing
        gst_element_set_state(_pipeline, GST_STATE_PLAYING);
    }
    

    When i run my application, it works fine on linux. I can receive the stream and display it. But when i build it for android I can't display the stream. I think i'm receiving the stream though, because the cam of the streaming pc works when app is running. Any ideas how I can solve this issue?

    Thanks.

    J 1 Reply Last reply 17 Oct 2024, 14:08
    0
    • K kuroro-l
      17 Oct 2024, 12:36

      This is my pipeline:

      Gstreamer_camera_capture::Gstreamer_camera_capture(std::string camera)
      {
          std::string pipeline_str = "rtspsrc location=" + camera + " latency=0 ! rtpjitterbuffer latency=10 ! rtph264depay ! avdec_h264 ! videoconvert ! video/x-raw,format=RGB ! appsink name=app_sink sync=false";
      
      
          this->_pipeline = gst_parse_launch(pipeline_str.c_str(), NULL);
      
          // Get app sink part of pipeline
          this->_app_sink = gst_bin_get_by_name(GST_BIN(_pipeline), "app_sink");
      
          g_object_set(this->_app_sink, "emit-signals", TRUE, NULL);
          g_signal_connect(this->_app_sink, "new-sample", G_CALLBACK(new_sample), this);
      
          // Start playing
          gst_element_set_state(_pipeline, GST_STATE_PLAYING);
      }
      

      When i run my application, it works fine on linux. I can receive the stream and display it. But when i build it for android I can't display the stream. I think i'm receiving the stream though, because the cam of the streaming pc works when app is running. Any ideas how I can solve this issue?

      Thanks.

      J Offline
      J Offline
      JoeCFD
      wrote on 17 Oct 2024, 14:08 last edited by
      #2

      @kuroro-l First, your code has nothing to do with Qt. When you build it for Android, you need to pack gstreamer build(libs and plugins) for Android with your app.

      If you want to use Qt sink in your pipeline, try to make a Qt GUI and use qml or widget sink in your pipeline. There are quite some posts about how to do it in this forum and gstreamer forum.

      1 Reply Last reply
      0

      1/2

      17 Oct 2024, 12:36

      • Login

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