C++ API: UDP streaming receiver not working
marcin at saepia.net
marcin at saepia.net
Tue May 31 21:54:40 UTC 2016
You have to start GLib MainLoop.
Remeber also to call gst_init
m.
2016-05-27 15:43 GMT+02:00 HM <hmarti at uji.es>:
> 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.
> _______________________________________________
> 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/20160531/0962ccc3/attachment.html>
More information about the gstreamer-devel
mailing list