Hi sorry for reposting . I am using the rtsp test-appsrc application and modified it to work for I420 format images with rtpvrawpay instead of rtph264pay . however for certain resolutions the pipeline fails like for e.g for 2100 x 576 it fails whereas works for 2104 x 576 but fails for 2106 x 576 and so on... i am not able to understand the pattern . This is the appsrc modified code for rtsp: #include <gst/gst.h> #include <gst/rtsp-server/rtsp-server.h> typedef struct { gboolean white; GstClockTime timestamp; } MyContext; /* called when we need to give data to appsrc */ static void need_data (GstElement * appsrc, guint unused, MyContext * ctx) { GstBuffer *buffer; guint size; GstFlowReturn ret; unsigned int sizeInt = (2100*576*3) >> 1; size = sizeInt;//2100 * 576 * 1.5; buffer = gst_buffer_new_allocate (NULL, size, NULL); /* this makes the image black/white */ gst_buffer_memset (buffer, 0, ctx->white ? 0xff : 0x0, size); ctx->white = !ctx->white; /* increment the timestamp every 1/2 second */ GST_BUFFER_PTS (buffer) = ctx->timestamp; GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1, GST_SECOND, 2); ctx->timestamp += GST_BUFFER_DURATION (buffer); g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret); } /* called when a new media pipeline is constructed. We can query the * pipeline and configure our appsrc */ static void media_configure (GstRTSPMediaFactory * factory, GstRTSPMedia * media, gpointer user_data) { GstElement *element, *appsrc; MyContext *ctx; /* get the element used for providing the streams of the media */ element = gst_rtsp_media_get_element (media); /* get our appsrc, we named it 'mysrc' with the name property */ appsrc = gst_bin_get_by_name_recurse_up (GST_BIN (element), "mysrc"); /* this instructs appsrc that we will be dealing with timed buffer */ gst_util_set_object_arg (G_OBJECT (appsrc), "format", "time"); /* configure the caps of the video */ g_object_set (G_OBJECT (appsrc), "caps", gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, "I420", "width", G_TYPE_INT, 2100, "height", G_TYPE_INT, 576, "framerate", GST_TYPE_FRACTION, 0, 1, NULL), NULL); ctx = g_new0 (MyContext, 1); ctx->white = FALSE; ctx->timestamp = 0; /* make sure ther datais freed when the media is gone */ g_object_set_data_full (G_OBJECT (media), "my-extra-data", ctx, (GDestroyNotify) g_free); /* install the callback that will be called when a buffer is needed */ g_signal_connect (appsrc, "need-data", (GCallback) need_data, ctx); gst_object_unref (appsrc); gst_object_unref (element); } int main (int argc, char *argv[]) { GMainLoop *loop; GstRTSPServer *server; GstRTSPMountPoints *mounts; GstRTSPMediaFactory *factory; gst_init (&argc, &argv); loop = g_main_loop_new (NULL, FALSE); /* create a server instance */ server = gst_rtsp_server_new (); gst_rtsp_server_set_address(server,"10.0.0.2"); /* get the mount points for this server, every server has a default object * that be used to map uri mount points to media factories */ mounts = gst_rtsp_server_get_mount_points (server); /* make a media factory for a test stream. The default media factory can use * gst-launch syntax to create pipelines. * any launch line works as long as it contains elements named pay%d. Each * element with pay%d names will be a stream */ factory = gst_rtsp_media_factory_new (); gst_rtsp_media_factory_set_launch (factory, "( appsrc name=mysrc ! rtpvrawpay name=pay0 pt=96 )"); /* notify when our media is ready, This is called whenever someone asks for * the media and a new pipeline with our appsrc is created */ g_signal_connect (factory, "media-configure", (GCallback) media_configure, NULL); /* attach the test factory to the /test url */ gst_rtsp_mount_points_add_factory (mounts, "/test", factory); /* don't need the ref to the mounts anymore */ g_object_unref (mounts); /* attach the server to the default maincontext */ gst_rtsp_server_attach (server, NULL); /* start serving */ g_print ("stream ready at rtsp://<a href="http://127.0.0.1:8554/test\n">127.0.0.1:8554/test\n"); g_main_loop_run (loop); return 0; } This pipeline fails with a segmentation fault when the client side is run as follows: gst-launch-1.0 rtspsrc latency=50 location=rtsp://10.0.0.2:8555/testing ! rtpvrawdepay ! videoconvert ! ximagesink -v with "could not read from resource" message on the client side. However the same code with 2104 x 576 works fine . NOTE: Also when i change I420 to NV12 and add a videoconvert before rtpvrawpay every resolution works well i.e by making the following change "( appsrc name=mysrc ! videconvert ! rtpvrawpay name=pay0 pt=96 )"); gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, "NV12", "width", G_TYPE_INT, 2100, "height", G_TYPE_INT, 576, Any help would be greatly appreciated. _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
I've faced the same issue before. Any suggestions would be appreciated. Thanks, Anuj On Nov 25, 2016 9:08 PM, "Tejas Ravichandran" <[hidden email]> wrote:
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by tejas95
On Fri, 2016-11-25 at 21:08 +0530, Tejas Ravichandran wrote:
> Hi sorry for reposting . > I am using the rtsp test-appsrc application and modified it to work > for I420 format images with rtpvrawpay instead of rtph264pay . > > however for certain resolutions the pipeline fails > like for e.g for 2100 x 576 it fails whereas works for 2104 x 576 but > fails for 2106 x 576 and so on... i am not able to understand the > pattern . > This is the appsrc modified code for rtsp: > [...] > stream ready at rtsp://127.0.0.1:8554/test > 0:00:06.888348556 9143 0x7f6a1c025c50 ERROR default > video-frame.c:175:gst_video_frame_map_id: invalid buffer size 1814400 > < 1815552 > fish: “./test” terminated by signal SIGSEGV (Address boundary error) It seems like the raw video you create is wrong. -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (981 bytes) Download Attachment |
On Mon, 2016-11-28 at 09:28 +0200, Sebastian Dröge wrote:
> On Fri, 2016-11-25 at 21:08 +0530, Tejas Ravichandran wrote: > > Hi sorry for reposting . > > I am using the rtsp test-appsrc application and modified it to work > > for I420 format images with rtpvrawpay instead of rtph264pay . > > > > however for certain resolutions the pipeline fails > > like for e.g for 2100 x 576 it fails whereas works for 2104 x 576 > > but > > fails for 2106 x 576 and so on... i am not able to understand the > > pattern . > > This is the appsrc modified code for rtsp: > > [...] > > Here your code just fails with a segmentation fault: > [...] http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=d0f608f60ba9b14fbec52eca892015061419e922 -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (981 bytes) Download Attachment |
do u mean to say rtpvrawpay has some input restrictions like on the width and height of the I420 buffer ? On Mon, Nov 28, 2016 at 1:01 PM, Sebastian Dröge <[hidden email]> wrote: On Mon, 2016-11-28 at 09:28 +0200, Sebastian Dröge wrote: _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On Mon, 2016-11-28 at 15:20 +0530, Tejas Ravichandran wrote:
> do u mean to say rtpvrawpay has some input restrictions like on the > width and height of the I420 buffer ? No, but you need to provide raw video buffers with the correct size in bytes for the given format/width/height. -- Sebastian Dröge, Centricular Ltd · http://www.centricular.com _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel signature.asc (981 bytes) Download Attachment |
No, but you need to provide raw video buffers with the correct size in But if it's working for NV12, shouldn't it work for I420 as well? As they have the same size per frame but only the UV Plane is rearranged.
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |