UDP sink Gstreamer + Android

Sebastian Dröge sebastian at centricular.com
Fri Apr 3 12:41:13 PDT 2015


On Fr, 2015-04-03 at 19:30 +0000, Dmitri Afanasjev wrote:
> Hello!
> 
> I have udp stream which is generated by:
> 
> raspivid -t 999999 -w 1296 -h 730 -fps 30 -b 20000000 -o - | gst-launch-1.0
> -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 name=pay0 config-interval=5 !
> udpsink host=<destination ip> port=5001
> 
> Receiver part on Windows looks like:
> 
> C:\Users\Dmitri>gst-launch-1.0 -e -v udpsrc port=5001 ! application/x-rtp,
> media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264,
>  sprop-parameter-sets=\"J2QA
> KKwrQCiC78kA8SJq\\,KO4fLA\\\=\\\=\", payload=(int)96 ! rtph264depay !
> avdec_h264 ! autovideosink
> 
> (caps are taken from transmitter part) so all works well.
> 
> Now i want to create the same pipeline in Android. I'm using tutorial 5
> from GStreamer SDK modified to work with RTMP streams as starting point.
> 
> when i create pipline with:
> 
> data->pipeline = gst_parse_launch("udpsrc port=5001
> caps=\"application/x-rtp, media=video,  clock-rate=90000,
> encoding-name=H264, payload=96\" ! rtph264depay ! h264parse ! avdec_h264 !
> autovideosink sync=false", &error);
> 
> nothing start playing and i see the error in logcat
> 
> W/GLib+GLib-GObject﹕ invalid cast from 'GstPipeline' to 'GstVideoOverlay'
> E/GLib﹕ gst_video_overlay_set_window_handle: assertion
> 'GST_IS_VIDEO_OVERLAY (overlay)' failed
> 
> As i understand I need to give the rendering point to my pipline, but error
> occured.
> 
> How its possible to receive UDP stream as I've done in Winows environment,
> how should look like pipline in Android JNI ?

The pipeline is correct, but you have to understand the actual code
there. Tutorial 5 uses playbin, which implements the GstVideoOverlay
interface. And that is used by Tutorial 5 to tell playbin where to
render the video.

A generic pipeline like yours does not implement GstVideoOverlay, so
Tutorial 5 just fails. You have to change the code so that it uses the
GstVideoOverlay interface of the video sink directly, see the
documentation how to do that.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150403/32ccf908/attachment.sig>


More information about the gstreamer-devel mailing list