<div dir="ltr"><div><div><div>I modified the test-appsrc application in gst-rtsp-server to stream out 2100 x 576 I420 image with rtpvrawpay as follows,<br><br>#include <gst/gst.h><br><br>#include <gst/rtsp-server/rtsp-server.h><br><br>typedef struct<br>{<br>  gboolean white;<br>  GstClockTime timestamp;<br>} MyContext;<br><br>/* called when we need to give data to appsrc */<br>static void<br>need_data (GstElement * appsrc, guint unused, MyContext * ctx)<br>{<br>  GstBuffer *buffer;<br>  guint size;<br>  GstFlowReturn ret;<br><br>  size = 1000 * 576 * 1.5;<br><br>  buffer = gst_buffer_new_allocate (NULL, size, NULL);<br><br>  /* this makes the image black/white */<br>  gst_buffer_memset (buffer, 0, ctx->white ? 0xff : 0x0, size);<br><br>  ctx->white = !ctx->white;<br><br>  /* increment the timestamp every 1/2 second */<br>  GST_BUFFER_PTS (buffer) = ctx->timestamp;<br>  GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1, GST_SECOND, 2);<br>  ctx->timestamp += GST_BUFFER_DURATION (buffer);<br><br>  g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret);<br>}<br><br>/* called when a new media pipeline is constructed. We can query the<br> * pipeline and configure our appsrc */<br>static void<br>media_configure (GstRTSPMediaFactory * factory, GstRTSPMedia * media,<br>    gpointer user_data)<br>{<br>  GstElement *element, *appsrc;<br>  MyContext *ctx;<br><br>  /* get the element used for providing the streams of the media */<br>  element = gst_rtsp_media_get_element (media);<br><br>  /* get our appsrc, we named it 'mysrc' with the name property */<br>  appsrc = gst_bin_get_by_name_recurse_up (GST_BIN (element), "mysrc");<br><br>  /* this instructs appsrc that we will be dealing with timed buffer */<br>  gst_util_set_object_arg (G_OBJECT (appsrc), "format", "time");<br>  /* configure the caps of the video */<br>  g_object_set (G_OBJECT (appsrc), "caps",<br>      gst_caps_new_simple ("video/x-raw",<br>          "format", G_TYPE_STRING, "I420",<br>          "width", G_TYPE_INT, 1000,<br>          "height", G_TYPE_INT, 576,<br>          "framerate", GST_TYPE_FRACTION, 0, 1, NULL), NULL);<br><br>  ctx = g_new0 (MyContext, 1);<br>  ctx->white = FALSE;<br>  ctx->timestamp = 0;<br>  /* make sure ther datais freed when the media is gone */<br>  g_object_set_data_full (G_OBJECT (media), "my-extra-data", ctx,<br>      (GDestroyNotify) g_free);<br><br>  /* install the callback that will be called when a buffer is needed */<br>  g_signal_connect (appsrc, "need-data", (GCallback) need_data, ctx);<br>  gst_object_unref (appsrc);<br>  gst_object_unref (element);<br>}<br><br>int<br>main (int argc, char *argv[])<br>{<br>  GMainLoop *loop;<br>  GstRTSPServer *server;<br>  GstRTSPMountPoints *mounts;<br>  GstRTSPMediaFactory *factory;<br><br>  gst_init (&argc, &argv);<br><br>  loop = g_main_loop_new (NULL, FALSE);<br><br>  /* create a server instance */<br>  server = gst_rtsp_server_new ();<br>gst_rtsp_server_set_address(server,"10.0.0.2");<br>  /* get the mount points for this server, every server has a default object<br>   * that be used to map uri mount points to media factories */<br>  mounts = gst_rtsp_server_get_mount_points (server);<br><br>  /* make a media factory for a test stream. The default media factory can use<br>   * gst-launch syntax to create pipelines.<br>   * any launch line works as long as it contains elements named pay%d. Each<br>   * element with pay%d names will be a stream */<br>  factory = gst_rtsp_media_factory_new ();<br>  gst_rtsp_media_factory_set_launch (factory,<br>      "( appsrc name=mysrc ! rtpvrawpay  name=pay0 pt=96 )");<br><br>  /* notify when our media is ready, This is called whenever someone asks for<br>   * the media and a new pipeline with our appsrc is created */<br>  g_signal_connect (factory, "media-configure", (GCallback) media_configure,<br>      NULL);<br><br>  /* attach the test factory to the /test url */<br>  gst_rtsp_mount_points_add_factory (mounts, "/test", factory);<br><br>  /* don't need the ref to the mounts anymore */<br>  g_object_unref (mounts);<br><br>  /* attach the server to the default maincontext */<br>  gst_rtsp_server_attach (server, NULL);<br><br>  /* start serving */<br>  g_print ("stream ready at rtsp://<a href="http://127.0.0.1:8554/test\n">127.0.0.1:8554/test\n</a>");<br>  g_main_loop_run (loop);<br><br>  return 0;<br>}<br><br></div>with client  side as:gst-launch-1.0 rtspsrc latency=50 location=rtsp://<a href="http://10.0.0.2:8554/test">10.0.0.2:8554/test</a> ! queue ! rtpjitterbuffer ! rtpvrawdepay !  videoconvert ! ximagesink -v<br><br></div>however when i increase the resolution of the image to 1500 x 576 or 2100 x 576 it fails giving a segmentation fault. and an "unable to read from resource" error on the client side.<br><br></div>stuck in this problem for a lot of time. Any help would be greatly appreciated. <br><div><div><br><br><br></div></div></div>