In order to stream live video from Raspberry Pi Cam to Android device I installed GStreamer 1.0 in Raspberry Pi. Then following this link https://stackoverflow.com/questions/18511765/gstreamer-in-android-udp-stream?rq=1

Executed the server and client side, but the output in the android device is coming like the screenshot given below.

Please advice what am I doing wrong or missing. Is there any other way of doing this?


Raspberry Pi Server:

raspivid -t 999999 -h 240 -w 320 -fps 25 -b 2000000 -o - | gst-launch-1.0 -v     fdsrc fd=0 ! h264parse ! rtph264pay ! udpsink host= port=5000

Android Client:

data->pipeline = gst_parse_launch("udpsrc port=5000 caps=\"application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\\\"J2QAFKwrQLj/LwDxImo\\\\=\\\\,KO4fLA\\\\=\\\\=\\\"\", ssrc=(uint)2607831725, clock-base=(uint)1706962490, seqnum-base=(uint)15791, payload=(int)96\" ! queue ! rtph264depay ! queue ! ffdec_h264 ! autovideosink sync=false", &error);

enter image description here

  • I'd recommend starting by halfing your bitrate (-b 1000000) and checking the result. The example you linked is for a 1920x1080 stream, which requires a significantly higher data rate than your 320x240 stream. – goobering Feb 10 '16 at 10:05
  • @goobering as per your suggestion i tried with different bit rates randomly ranging it from 4000 to 4000000 but it gives the same out put for all with lower bit rates we get a more greyish view. – user3739769 Feb 10 '16 at 11:05
  • Try using something like VLC to open the stream on a desktop client. If the stream opens without issue then the problem's in the Android device. If it's identically corrupted then the problem's in the Pi. – goobering Feb 10 '16 at 13:52
  • Use UV4L to stream from/to android instead of the gstreamer sauce. – prinxis Feb 10 '16 at 22:52

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.