C++ API: UDP streaming receiver not working

HM hmarti at uji.es
Fri May 27 13:43:13 UTC 2016


Hi, I'm quite new to Gstreamer. I'm trying to play a UDP streaming usign
gstreamer 1.0. The video is from a camera (full HD, 1920x1080, 25 fps), is
encoded into the h.264 compression. It is transmitted via UDP as mpeg-ts
packets. Receiving port is 49152.

My code is:

 GstElement* pipeline = gst_pipeline_new("my_pipeline");

 GstElement* src = gst_element_factory_make("udpsrc", NULL);
 g_object_set(src, "port", 49152, NULL);

 GstElement* mpegtsdemux = gst_element_factory_make("tsdemux", NULL);

 GstElement* queue = gst_element_factory_make("queue", NULL);
 
 GstElement* ffdec = gst_element_factory_make("avdec_h264", NULL);
 g_object_set(ffdec, "max_threads", 0, NULL);

 GstElement* ffmpeg = gst_element_factory_make("videoconvert", NULL);

 GstElement* xvimagesink = gst_element_factory_make("xvimagesink", "video");
 if (!pipeline | !src | !mpegtsdemux | !queue | !ffdec | !xvimagesink )
 {
        std::cout << "Error creating components." << std::endl;
        return;
 }

 gst_bin_add_many(GST_BIN(pipeline), src, mpegtsdemux, queue, ffdec, ffmpeg,
xvimagesink, NULL);
 if (gst_element_link_many(src, mpegtsdemux, queue, ffdec, ffmpeg,
xvimagesink, NULL) != true)
 {
       std::cout << "Error linking gstreamer elements." << std::endl;
       return;
 }

 gst_element_set_state(pipeline, GST_STATE_PLAYING);

The program executes but nothing is shown. Any help is welcome.
H




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/C-API-UDP-streaming-receiver-not-working-tp4677784.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list