<div dir="ltr"><div>You have to start GLib MainLoop.<br></div><div><br></div><div>Remeber also to call gst_init<br><br></div>m.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-27 15:43 GMT+02:00 HM <span dir="ltr"><<a href="mailto:hmarti@uji.es" target="_blank">hmarti@uji.es</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, I'm quite new to Gstreamer. I'm trying to play a UDP streaming usign<br>
gstreamer 1.0. The video is from a camera (full HD, 1920x1080, 25 fps), is<br>
encoded into the h.264 compression. It is transmitted via UDP as mpeg-ts<br>
packets. Receiving port is 49152.<br>
<br>
My code is:<br>
<br>
GstElement* pipeline = gst_pipeline_new("my_pipeline");<br>
<br>
GstElement* src = gst_element_factory_make("udpsrc", NULL);<br>
g_object_set(src, "port", 49152, NULL);<br>
<br>
GstElement* mpegtsdemux = gst_element_factory_make("tsdemux", NULL);<br>
<br>
GstElement* queue = gst_element_factory_make("queue", NULL);<br>
<br>
GstElement* ffdec = gst_element_factory_make("avdec_h264", NULL);<br>
g_object_set(ffdec, "max_threads", 0, NULL);<br>
<br>
GstElement* ffmpeg = gst_element_factory_make("videoconvert", NULL);<br>
<br>
GstElement* xvimagesink = gst_element_factory_make("xvimagesink", "video");<br>
if (!pipeline | !src | !mpegtsdemux | !queue | !ffdec | !xvimagesink )<br>
{<br>
std::cout << "Error creating components." << std::endl;<br>
return;<br>
}<br>
<br>
gst_bin_add_many(GST_BIN(pipeline), src, mpegtsdemux, queue, ffdec, ffmpeg,<br>
xvimagesink, NULL);<br>
if (gst_element_link_many(src, mpegtsdemux, queue, ffdec, ffmpeg,<br>
xvimagesink, NULL) != true)<br>
{<br>
std::cout << "Error linking gstreamer elements." << std::endl;<br>
return;<br>
}<br>
<br>
gst_element_set_state(pipeline, GST_STATE_PLAYING);<br>
<br>
The program executes but nothing is shown. Any help is welcome.<br>
H<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/C-API-UDP-streaming-receiver-not-working-tp4677784.html" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/C-API-UDP-streaming-receiver-not-working-tp4677784.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>