<div dir="ltr"><div dir="ltr">Hi Nicolas,<br></div><div><br></div><div>I have been trying to setup the app from my RTSP Server to tap into the appsink. <br></div><div><br></div><div><b>1) I invoke the media_configure callback on rtsp_media_factory:   </b><br></div><div><br></div><div>g_signal_connect(gst_rtsp_factory_var, "media-configure", (GCallback) media_configure, NULL);   >>this is working<br></div><div><br></div><div><b>2)  my media configure method looks like the following (and it seems to run ok and gives me log outputs without any errors):</b><br></div><div><br></div><div>string pipeline = "v4l2src device=/dev/video1 ! video/x-raw, width=1920, height=1080, 
framerate=15/1  ! queue  max-size-bytes=50000000 max-size-time=500000000
 max-size-buffers=10  ! vpuenc_h264  ! appsink name=h264vid ";<br>ctx->generator_pipe =  gst_parse_launch(pipeline.c_str(), NULL);</div><div><br></div><div>  g_object_set_data_full (G_OBJECT (media), "rtsp-extra-data", ctx,  (GDestroyNotify) ctx_free);<br>  element = gst_rtsp_media_get_element (media);<br><br>  caps = gst_caps_new_simple ("video/x-h264",<br>      //"stream-format", G_TYPE_STRING, "byte-stream",<br>      "width", G_TYPE_INT, 1920, "height", G_TYPE_INT, 1080,<br>      "framerate", GST_TYPE_FRACTION, 15, 1, NULL);<br>    <br>  ctx->vid_appsrc = appsrc =  gst_bin_get_by_name_recurse_up (GST_BIN (element), "h264videosrc");<br>    <br>  ctx->vid_appsink = appsink =   gst_bin_get_by_name (GST_BIN (ctx->generator_pipe), "h264vid");<br>      <br>  g_signal_connect (appsrc, "need-data", (GCallback) need_data, ctx);<br>  gst_caps_unref (caps);<br>  gst_element_set_state (ctx->generator_pipe, GST_STATE_PLAYING); <br>  gst_object_unref (element);</div><div><br></div><div><b>3) In my "need_data" is where I am getting the error, the "sample" variable is empty.</b><br></div><div><br></div><div>GstSample *sample;<br>GstFlowReturn ret;<br>sample = gst_app_sink_pull_sample (GST_APP_SINK (ctx->vid_appsink));</div><div><br></div><div><b>4) My RTSP Server is setup with the pipeline as follows:</b></div><div><br></div><div>pipeline_config = "appsrc name=h264videosrc ! queue ! rtph264pay name=pay0 pt=96";</div><div>gst_rtsp_media_factory_set_launch(factory, rtsp_pipeline_config.c_str());</div><div><br></div><div><br></div><div>Do you have any idea what is going wrong and what I can do to debug this ?<br></div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 10, 2021 at 12:24 PM Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca">nicolas@ndufresne.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>Le vendredi 10 septembre 2021 à 10:18 -0400, Dwight Kulkarni via gstreamer-devel a écrit :</div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I am trying to test a pipeline from gst-launch-1.0 that has an appsink and a tee. </div><div><br></div><div>The first pipeline with autovideosink below showed video and saved the files. The second pipeline I changed autovideosink to appsink and it stopped saving the files.</div><div><br></div><div>Interestingly, the second pipeline runs and doesn't show any errors, but no files are outputted from the splitmuxsink.</div><div><br></div><div><br></div><div><b>works:</b><br>gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, width=1920, height=1080, framerate=15/1  ! vpuenc_h264 ! tee name=v ! avdec_h264 ! autovideosink v. ! h264parse ! splitmuxsink name=filesink location=video%02d.mkv max-size-time=10000000000 muxer-properties="properties,streamable=true"<br><br><b>doesn't work:</b><br>gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, width=1920, height=1080, framerate=15/1  ! vpuenc_h264 ! tee name=v ! appsink name=h264vid v. ! h264parse ! splitmuxsink name=filesink location=video%02d.mkv max-size-time=10000000000 muxer-properties="properties,streamable=true"<br></div></div></blockquote><div><br></div><div>You need to writ an app around appsink in order to pop the buffers out of it, otherwise your pipeline will stall very quickly.</div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div> <br clear="all"><div><br></div><div><br></div>--<br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><span style="font-size:12.8px">Sincerely,</span><div><br></div><div>Dwight Kulkarni </div></div></div></div></div></div></div></div></div></blockquote><div><br></div><div><span></span></div></div>
</blockquote></div><br clear="all"><br><br></div>