Monday, March 25, 2013

Video streaming using Gstreamer

A major part of our project is to stream live video from a camera mounted on the Bot to the Android phone. We are using "Microsoft Lifecam Vx-5000" connected to Beaglebone via USB to capture the video.
Gstreamer is an open souce multi-media framework and is widely used for media streaming. It is well documented and provides an easy to use command line interface. The major hurdle in using Gstreamer was to find the right set of commands to reduce the lag in the streaming to less than a second.

Gstreamer Commands Used:
Beaglebone:
 gst-launch v4l2src device=/dev/video0 ! videorate ! video/x-raw-yuv,width=160,height=120,framerate=6/1 !   
 jpegenc quality=30 ! multipartmux ! tcpserversink port=5000  

Client(PC and Android):
 gst-launch tcpclientsrc host=localhost port=5000!multipartdemux!jpegdec!autovideosink  

We used very low resolution (160 X 120) to achieve the low lag requirement. Using these commands, the lag in the streaming was reduced to less than half a second.


Gstreamer on Android:

We followed the tutorial given here to install Gstreamer on Android. We had to install JNI and Gstreamer SDK to build Gstreamer projects in Eclipse. After configuring Eclipse, we made small modifications (changed the string in the gst_parse_launch to the client command given above) to this tutorial to make the app work according to our requirement.

3 comments:

  1. Hey is it possible that you could post the project file for this? It be really helpful as I'm trying to get a live stream but I keep getting a pipline error or a parsing error :/
    Cheers

    ReplyDelete
  2. Excellent website you have here: so much cool information!.. https://www.eliaandponto.com/

    ReplyDelete
  3. This is my first time i visit here and I found so many interesting stuff in your blog especially it's discussion, thank you. uscreen app

    ReplyDelete