UDP Streaming in SDK

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

UDP Streaming in SDK

thegrinch
Hi, I'm trying to use Gstreamer SDK to recieve a UDP stream, I have it working via the command line, but I can't seem to find any documentation on how to use it within the SDK. 

I assume it would just be a matter of setting the source correctly, I was looking for a way to change: 

data.source = gst_element_factory_make ("uridecodebin", "source"); 

and 

g_object_set (data.source, "uri", "http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL); 

Is this the correct way of doing this? Thanks! 

Command Line Mac: 
gst-launch-1.0 udpsrc port=5001 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false 

Command Line Raspberry Pi: 
raspivid -t 999999 -b 2000000 -o - | gst-launch-1.0 -e -vvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=(MAC's IP Address) port=5000

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: UDP Streaming in SDK

Sebastian Dröge-3
On Mon, 2016-10-24 at 18:39 -0400, Emmett Palaima wrote:
> [...]
>
> Is this the correct way of doing this? Thanks! 
>
> Command Line Mac: 
> gst-launch-1.0 udpsrc port=5001 ! application/x-rtp, payload=96 !
> rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink
> sync=false text-overlay=false 

You could use the same pipeline and just use
  gst_parse_launch()
instead of
  gst_element_factory_make()

above. Or you manually build that pipeline step by step. Instead of the
capsfilter, you can also set the caps on the "caps" property of udpsrc
(note that the caps in your commandline there are syntax sugar for
using the capsfilter element and setting that as the caps property).

> Command Line Raspberry Pi: 
> raspivid -t 999999 -b 2000000 -o - | gst-launch-1.0 -e -vvv fdsrc !
> h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=(MAC's
> IP Address) port=5000

You probably want to use rpicamsrc instead of this duct-tape solution
via piping: https://github.com/thaytan/gst-rpicamsrc

--
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 (949 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: UDP Streaming in SDK

thegrinch
That makes sense. Just to make sure I am understanding this correctly, would I just put the command line I am using to create the pipeline into gst_parse_launch verbatim? So:

gst_parse_launch("gst-launch-1.0 udpsrc port=5001 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false", &errorptr);

Also, if I want to set up each element of the pipeline individually, how would I read from a udp source? That was one of the main things I was looking for and could not seem to find. 

I will also definitely check out the Raspberry Pi link you posted. It seems that your method is more robust.

Thank you for all your help!


On Tue, Oct 25, 2016 at 6:51 AM, Sebastian Dröge <[hidden email]> wrote:
On Mon, 2016-10-24 at 18:39 -0400, Emmett Palaima wrote:
> [...]
>
> Is this the correct way of doing this? Thanks! 
>
> Command Line Mac: 
> gst-launch-1.0 udpsrc port=5001 ! application/x-rtp, payload=96 !
> rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink
> sync=false text-overlay=false 

You could use the same pipeline and just use
  gst_parse_launch()
instead of
  gst_element_factory_make()

above. Or you manually build that pipeline step by step. Instead of the
capsfilter, you can also set the caps on the "caps" property of udpsrc
(note that the caps in your commandline there are syntax sugar for
using the capsfilter element and setting that as the caps property).

> Command Line Raspberry Pi: 
> raspivid -t 999999 -b 2000000 -o - | gst-launch-1.0 -e -vvv fdsrc !
> h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=(MAC's
> IP Address) port=5000

You probably want to use rpicamsrc instead of this duct-tape solution
via piping: https://github.com/thaytan/gst-rpicamsrc

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: UDP Streaming in SDK

Sebastian Dröge-3
On Tue, 2016-10-25 at 11:45 -0400, Emmett Palaima wrote:
> That makes sense. Just to make sure I am understanding this
> correctly, would I just put the command line I am using to create the
> pipeline into gst_parse_launch verbatim? So:
>
> gst_parse_launch("gst-launch-1.0 udpsrc port=5001 ! application/x-
> rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 !
> fpsdisplaysink sync=false text-overlay=false", &errorptr);

Without the "gst-launch-1.0 " part at the beginning, yes. Why do you
use sync=false btw?

Also you can do
  udpsrc port=5001 caps="application/x-rtp..." ! rtpjitterbuffer ! ...
instead of the separate element.

Note however that your RTP caps are incomplete, more fields are
needed. Check the caps on the sinkpad template in
  gst-inspect-1.0 rtph264depay

> Also, if I want to set up each element of the pipeline individually,
> how would I read from a udp source? That was one of the main things I
> was looking for and could not seem to find. 

Take a look at this example
  https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/rtp/client-PCMA.c#n150

> I will also definitely check out the Raspberry Pi link you posted. It
> seems that your method is more robust.

It's also noticeable more efficient :)

--
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 (949 bytes) Download Attachment