Hi,
I am trying to get the frames of a rtsp camera and work with the images. I have the following code more or less:
string pipeline = "rtspsrc location=rtsp://192.168.1.162/z3-1.mp4 latency=1000 drop-on-latency=true ! application/x-rtp,encoding-name=H265,payload=96,framerate=20/1 ! queue max-size-bytes=0 max-size-time=250 ! rtph265depay ! video/x-h265, stream-format=byte-stream,framerate=20/1 ! nvv4l2decoder enable-max-performance=true ! queue max-size-bytes=0 max-size-time=250 ! nvvidconv output-buffers=5 name=myconv ! video/x-raw(memory:NVMM), format=RGBA ! nvvidconv output-buffers=5 ! video/x-raw(memory:NVMM), format=NV12 ! queue max-size-bytes=0 max-size-time=250 ! nvv4l2vp9enc maxperf-enable=true bitrate=3000000 ! video/x-vp9 ! rtpvp9pay ! udpsink host=224.1.1.1 port=5000 sync=false auto-multicast=true;" gst_pipeline = (GstPipeline *)gst_parse_launch(pipeline.c_str(), &gerror); if (gst_pipeline == nullptr) { std::string err(gerror->message); std::string log = "Failed to parse launch with error: " + err; return; } if (gerror) { g_error_free(gerror); } conv = gst_bin_get_by_name(GST_BIN(gst_pipeline), "myconv"); src_pad = gst_element_get_static_pad(conv, "src"); gst_pad_add_probe(src_pad, GST_PAD_PROBE_TYPE_BUFFER, frame_processing, NULL, NULL); ret = gst_element_set_state((GstElement *)gst_pipeline, GST_STATE_PLAYING); if (ret == GST_STATE_CHANGE_FAILURE) { exit(0); } bus = gst_pipeline_get_bus(GST_PIPELINE(gst_pipeline)); cout << "0.1" << endl; gst_bus_poll(bus, GST_MESSAGE_EOS, GST_CLOCK_TIME_NONE); cout << "0.2" << endl; } catch (exception &e) { cout << e.what() << endl;
My problem is that my program never enters in the function “frame_processing” and the pipeline isn’t work. The pipeline is right because if I through the pipeline in a terminal works.
Some ideas?
Thanks in advance