How to check from server side if RTP stream is coming in on UDP port?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to check from server side if RTP stream is coming in on UDP port?

skryabin
Hello,

I have an RTP stream UDP client/server setup, and the server side (receiving end of the stream) is a Cocoa Mac OS X application.

I would like to check, using gstreamer, if the camera is currently sending data.

Using:

ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);

I always get GST_STATE_CHANGE_ASYNC, whether or not the client is sending the RTP stream or not.

Is there any way to perform this kind of validation, using gstreamer?

Thanks!

Alexandre

Reply | Threaded
Open this post in threaded view
|

Re: How to check from server side if RTP stream is coming in on UDP port?

Sebastian Dröge-3
On Sun, 2016-11-13 at 16:59 -0800, skryabin wrote:

> Hello,
>
> I have an RTP stream UDP client/server setup, and the server side (receiving
> end of the stream) is a Cocoa Mac OS X application.
>
> I would like to check, using gstreamer, if the camera is currently sending
> data.
>
> Using:
>
> ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);
>
> I always get GST_STATE_CHANGE_ASYNC, whether or not the client is sending
> the RTP stream or not. 
>
> Is there any way to perform this kind of validation, using gstreamer?
It depends on your exact pipeline. But you could always do something
like adding a watchdog element somewhere in the pipeline, or a pad
probe, to check if data is flowing regularly there.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to check from server side if RTP stream is coming in on UDP port?

skryabin
Hi Sebastian,

Which watchdog element (or pad probe) would you suggest, that would
induce the least latency (or none, ideally)?

Here are my working pipelines...

Sending side:

gst-launch-1.0 -v videotestsrc ! jpegenc ! rtpjpegpay ! udpsink
host=192.168.1.100 port=5005

Receiving end (in my application):

GstElement* pipeline = gst_pipeline_new ("pipeline");

     GstElement* videosrc  = gst_element_factory_make ("udpsrc", NULL);
     GstCaps *udp_caps = gst_caps_from_string ("application/x-rtp,
media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG,
payload=(int)26");
     g_object_set (videosrc, "port", 5005, "caps", udp_caps, NULL);

     GstElement* rtpjpegdepay = gst_element_factory_make("rtpjpegdepay",
NULL);
     GstElement* decodebin = gst_element_factory_make("jpegdec", NULL);
     GstElement* videosink = gst_element_factory_make
("caopengllayersink", NULL);

     gst_bin_add_many (GST_BIN (pipeline), videosrc, rtpjpegdepay,
decodebin, videosink, NULL);

     gboolean phase1_ok = gst_element_link_filtered(videosrc,
rtpjpegdepay, udp_caps);
     gst_caps_unref(udp_caps);
     gboolean phase2_ok = gst_element_link(rtpjpegdepay,decodebin);
     gboolean phase3_ok = gst_element_link(decodebin,videosink);

Many thanks!

Alexandre

Le 2016-11-14 04:58, Sebastian Dröge-3 [via GStreamer-devel] a écrit :

> On Sun, 2016-11-13 at 16:59 -0800, skryabin wrote:
>
>> Hello,
>>
>> I have an RTP stream UDP client/server setup, and the server side
> (receiving
>> end of the stream) is a Cocoa Mac OS X application.
>>
>> I would like to check, using gstreamer, if the camera is currently
> sending
>> data.
>>
>> Using:
>>
>> ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);
>>
>> I always get GST_STATE_CHANGE_ASYNC, whether or not the client is
> sending
>> the RTP stream or not.
>>
>> Is there any way to perform this kind of validation, using
> gstreamer? It depends on your exact pipeline. But you could always do
> something
> like adding a watchdog element somewhere in the pipeline, or a pad
> probe, to check if data is flowing regularly there.
>
> --
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com [1]
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email] [2]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel [3]
>
>  SIGNATURE.ASC (981 bytes) Download Attachment [4]
>
> -------------------------
>
> If you reply to this email, your message will be added to the
> discussion below:
> http://gstreamer-devel.966125.n4.nabble.com/How-to-check-from-server-side-if-RTP-stream-is-coming-in-on-UDP-port-tp4680662p4680672.html
> [5]
>  To unsubscribe from How to check from server side if RTP stream is
> coming in on UDP port?, click here [6].
> NAML [7]
>
> Links:
> ------
> [1] http://www.centricular.com
> [2]
> http://webmail.vovan.ca/user/SendEmail.jtp?type=node&node=4680672&i=0
> [3] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> [4]
> http://gstreamer-devel.966125.n4.nabble.com/attachment/4680672/0/signature.asc
> [5]
> http://gstreamer-devel.966125.n4.nabble.com/How-to-check-from-server-side-if-RTP-stream-is-coming-in-on-UDP-port-tp4680662p4680672.html
> [6]
> [7]
>
http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml

Reply | Threaded
Open this post in threaded view
|

Re: How to check from server side if RTP stream is coming in on UDP port?

Sebastian Dröge-3
On Mon, 2016-11-14 at 03:20 -0800, skryabin wrote:
> Hi Sebastian, 
>
> Which watchdog element (or pad probe) would you suggest, that would 
> induce the least latency (or none, ideally)? 

The *watchdog* element. There is only one :) And it introduces no
latency, it just gives you a GstMessage if there was no activity for a
configurable amount of time.

> Here are my working pipelines... 
> [...]
> Receiving end (in my application): 
> [...]

You should probably also consider adding a rtpjitterbuffer before the
depayloader here.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to check from server side if RTP stream is coming in on UDP port?

skryabin
Thank you Sebastian! ;)

I have finally implemented it with:

gst_bus_timed_pop_filtered(bus, 50 * GST_MSECOND,
GST_MESSAGE_ASYNC_DONE)

It keeps my pipeline "clean"... ;)

Thanks for the recommandation of rtpjitterbuffer. My aim is to have the
least latency possible, so this would add to my latency, wouldn't it?
Presently, it works quite well without the buffer.

Cheers,

Alexandre

Le 2016-11-14 06:58, Sebastian Dröge-3 [via GStreamer-devel] a écrit :

> On Mon, 2016-11-14 at 03:20 -0800, skryabin wrote:
>> Hi Sebastian,
>>
>> Which watchdog element (or pad probe) would you suggest, that would
>
>> induce the least latency (or none, ideally)?
>
> The *watchdog* element. There is only one :) And it introduces no
> latency, it just gives you a GstMessage if there was no activity for a
>
> configurable amount of time.
>
>> Here are my working pipelines...
>> [...]
>> Receiving end (in my application):
>> [...]
>
> You should probably also consider adding a rtpjitterbuffer before the
> depayloader here.
>
> --
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com [1]
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email] [2]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel [3]
>
>  SIGNATURE.ASC (981 bytes) Download Attachment [4]
>
> -------------------------
>
> If you reply to this email, your message will be added to the
> discussion below:
> http://gstreamer-devel.966125.n4.nabble.com/How-to-check-from-server-side-if-RTP-stream-is-coming-in-on-UDP-port-tp4680662p4680680.html
> [5]
>  To unsubscribe from How to check from server side if RTP stream is
> coming in on UDP port?, click here [6].
> NAML [7]
>
> Links:
> ------
> [1] http://www.centricular.com
> [2]
> http://webmail.vovan.ca/user/SendEmail.jtp?type=node&node=4680680&i=0
> [3] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> [4]
> http://gstreamer-devel.966125.n4.nabble.com/attachment/4680680/0/signature.asc
> [5]
> http://gstreamer-devel.966125.n4.nabble.com/How-to-check-from-server-side-if-RTP-stream-is-coming-in-on-UDP-port-tp4680662p4680680.html
> [6]
> [7]
>
http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml

Reply | Threaded
Open this post in threaded view
|

Re: How to check from server side if RTP stream is coming in on UDP port?

Sebastian Dröge-3
On Tue, 2016-11-15 at 03:41 -0800, skryabin wrote:

> Thank you Sebastian! ;) 
>
> I have finally implemented it with: 
>
> gst_bus_timed_pop_filtered(bus, 50 * GST_MSECOND, 
> GST_MESSAGE_ASYNC_DONE) 
>
> It keeps my pipeline "clean"... ;) 
>
> Thanks for the recommandation of rtpjitterbuffer. My aim is to have the 
> least latency possible, so this would add to my latency, wouldn't it? 
> Presently, it works quite well without the buffer. 
It adds a configurable amount of latency, but for that price you get
resilience against packet arrival time jitter and packet reordering,
which otherwise would cause visible/audible problems.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment