Udpsrc to autovideosink
philippe renon
philippe_renon at yahoo.fr
Wed Sep 13 08:47:57 UTC 2017
Not sure it explains your issue, but you don't set the same caps in the CLI pipeline and C pipeline.
And you might want to get the detailed error message (using debug output or some other mean).
Le Mercredi 13 septembre 2017 9h49, chrplus3 <christian.bauer at mekra.de> a écrit :
I've just seen, that raw text is not working in this mailing list.
Here is the code again:
Working:
gst-launch-1.0 -v \
udpsrc port=5016 caps="application/x-rtp,encoding-name=JPEG,payload=26" ! \
rtpjpegdepay ! jpegparse ! queue max-size-time=0 max-size-buffers=0 !
jpegdec ! autovideosink
Not working (because element link failed):
...
GstElement *pipeline, *source, *depay, *parse, *queue, *decode, *sink;
GstCaps *caps;
gst_init(&argc, &argv);
pipeline = gst_pipeline_new("pipe");
source = gst_element_factory_make("udpsrc", "source");
depay = gst_element_factory_make("rtpjpegdepay", "depay");
parse = gst_element_factory_make("jpegparse", "parse");
queue = gst_element_factory_make("queue", "queue");
decode = gst_element_factory_make("jpegdec", "decode");
sink = gst_element_factory_make("autovideosink", "sink");
caps = gst_caps_new_simple(
"video/x-rtp",
"encoding-name", G_TYPE_STRING, "JPEG",
"payload", G_TYPE_INT, 26, NULL);
g_object_set(G_OBJECT(source),
"port", 5016,
"caps", caps, NULL);
g_object_set(G_OBJECT(queue),
"max-size-time", 0,
"max-size-buffers", 0, NULL);
gst_bin_add_many(GST_BIN(pipeline), source, depay, parse, queue, decode,
sink, NULL);
if(!gst_element_link_many(source, depay, parse, queue, decode, sink, NULL))
{
g_printerr("Elements could not be linked.\n");
gst_object_unref(pipeline);
return -1;
}
gst_element_set_state(pipeline, GST_STATE_PLAYING);
...
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170913/a55ca890/attachment.html>
More information about the gstreamer-devel
mailing list