yet another udpsink question from a new user
Tomaz Canabrava
tcanabrava at kde.org
Fri Feb 12 17:53:56 UTC 2016
Hey people,
Sorry if this was already asked tons of times before, but I tried to do my
homework. I'm eating GStreamer documentation and managed to create a webcam
streaming that doesn't use v4l by pooling the images directly from it and
creating a pipeline througth appsrc to autovideosink, and it works.
when I try to create a pipeline to udpsink, however, it only calls the
data_callback once, and doesn't streams anything.
My pipeline:
appsrc -> videoconverter -> avenc_mpeg4 -> rtpmp4vpay -> udpsink
My configurations:
/* setup pipeline */
GstElement *pipeline = gst_pipeline_new ("pipeline");
GstElement *appsrc = gst_element_factory_make("appsrc", "source");
GstElement *conv = gst_element_factory_make("videoconvert", "conv");
GstElement *videosink = gst_element_factory_make("xvimagesink",
"videosink");
GstElement *videoenc = gst_element_factory_make("avenc_mpeg4",
"ffenc_mpeg4");
GstElement *payloader = gst_element_factory_make("rtpmp4vpay",
"rtpmp4vpay");
GstElement *udpsink = gst_element_factory_make("udpsink", "udpsink");
GstElement *freeze = gst_element_factory_make("imagefreeze",
"imagefreeze0");
GstElement *colorspace = gst_element_factory_make("ffmpegcolorspace",
"colorspace");
g_object_set(G_OBJECT(udpsink), "host", "127.0.0.1", "port", 5000, NULL);
g_object_set(G_OBJECT(payloader), "config-interval", 60, NULL);
/* setup */
g_object_set (G_OBJECT (appsrc), "caps",
gst_caps_new_simple ("video/x-raw",
"format", G_TYPE_STRING, "RGB",
"width", G_TYPE_INT, width,
"height", G_TYPE_INT, height,
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
"framerate", GST_TYPE_FRACTION, 0, 1,
NULL), NULL);
// WORKS
gst_bin_add_many (GST_BIN (pipeline), appsrc, conv, videosink, NULL);
gst_element_link_many (appsrc, conv, videosink, NULL);
// DOESNT WORKS
gst_bin_add_many (GST_BIN (pipeline), appsrc, conv, videoenc, payloader,
udpsink, NULL);
gst_element_link_many (appsrc, conv, videoenc, payloader, udpsink, NULL);
/* setup appsrc */
g_object_set (G_OBJECT (appsrc),
"stream-type", 0,
"is-live", TRUE,
"format", GST_FORMAT_TIME, NULL);
references:
[1] : https://gist.github.com/beeender/d539734794606a38d4e3
[2] :
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-udpsrc.html
[3] :
http://stackoverflow.com/questions/34009566/how-to-send-qimages-via-gstreamer-over-udp
and a few more. Most of the code I found on the internet is about creating
pipelines via gst-launcher, I know I can create one from it but didn't
managed to build a plugin for my stuff to test, yet.
Thanks for any help,
Tomaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160212/74cfa60d/attachment.html>
More information about the gstreamer-devel
mailing list