Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Android RC Car with Live Video Camera Streaming


We developed a system streaming video from a camera which was on an RC car. You can build this system on your own with your Android phone by less than $100.

This article based on the previous articles, "Web Cam Streaming from Raspberry Pi to Android using gstreamer" and "iRacer Controller Android Application".

Hardware

Items

Raspberry Pi
with a case
PS3 Eye Battery iRacer (RC Car)


Best Raspberry PI Kit (Recommended!)

RC Car appearance

Side-View
Front-View

                                                


System Diagram

Android Application

You can download the Android application source code from here.
Make sure that you choose the branch name "withStreaming".


iRacer Controller Android Application



I wrote a simple Android application for iRacer controller. This video is a demo of the application.

Application source code is disclosed here.



Raspberry Pi: Streaming video and microphone with Android

  1. Android Application
    SimpleMjpegView was modified using Audiotrack.
    Source code is available here. (TBD)


    Best Raspberry PI Kit (Recommended!)



  2. Gstreamer SettingsTX (RPi)
    gst-launch -v v4l2src ! ffmpegcolorspace ! video/x-raw-yuv,width=320,height=240,framerate=\(fraction\)30/1 ! queue ! videorate ! video/x-raw-yuv,framerate=15/1 ! jpegenc quality=50 ! multipartmux ! tcpserversink host=x.x.x.x port=5000 sync=false alsasrc device=hw:1 ! audioconvert ! audioresample ! 'audio/x-raw-int,rate=8000,width=16,channels=1' ! udpsink host=x.x.x.x port=5001
      (Note: host IP address should be android IP address.)

                                                   


Hardware:
    Raspberry Pi
    PS3 Eye
    EW-7781Uh WiFi dongle
    Android phone (Droid X)

Summary:
    Android application was tested.
    Jpecenc and PCM was used for video and audio encoder, respectively.
    The audio latency was still not so great (~1 sec), but video was reasonable (< 1 sec). 
    RPi CPU usage was around 70%. (top command)  

Reference:
http://rxwen.blogspot.com/2011/10/stream-audio-via-udp-on-android.html
https://bitbucket.org/neuralassembly/simplemjpegview

Web Cam streaming from Raspberry Pi to Android using streamer



I tried to stream video from webcam connected with Raspberry Pi to Android phone.


Hardware

webcam : PS3 Eye
Android Phone : Motorola RAZR XT912


Best Raspberry PI Kit (Recommended!)

       

Set up Raspberry Pi

Install gstreamer

Update your Raspbian before install gstreamer packages.
sudo apt-get upgrade
sudo apt-get update
Install gstreamer packages.
sudo apt-get install gstreamer-tools gstreamer0.10-plugins-bad gstreamer0.10-plugins-good v4l-utils

Create gstreamer start script

I like tcsh shell.
sudo apt-get install tcsh
Create the script gst-server.sh to start gstreamer streaming server. 
#!/bin/tcsh

set myip=192.168.0.103
set port=5000
set width=320
set height=240

gst-launch\
  v4l2src !\
  ffmpegcolorspace !\
  video/x-raw-yuv,width=${width},height=${height},framerate=\(fraction\)30/1 !\
  jpegenc !\
  tcpserversink host=${myip} port=${port} sync=false
 Add an executable permission to the script.
chmod u+x gst-server.sh

Connect a webcam

I used PS3 Eye as a webcam. You can use other webcams.

Start gstreamer

Run the script.
./gst-server.sh


                                                   


If you want to stream microphone as well, check this out.

Set up Android phone

I created an Android application simplemjpegview_gst based on SimpleMjpegStreamer. You can download the source codes.

You can download apk file here.
https://docs.google.com/file/d/0B1V8jj4Adbrpdzl4VGVjcW1GT28/edit?usp=sharing




Supported Video Format on Android

Supported video formats on Android are the following. These are minimum requirement. Some phones supports other extra video formats.

VideoH.263• 3GPP (.3gp)
• MPEG-4 (.mp4)
H.264 AVC
(Android 3.0+)
Baseline Profile (BP)• 3GPP (.3gp)
• MPEG-4 (.mp4)
• MPEG-TS (.ts, AAC audio only, not seekable, Android 3.0+)
MPEG-4 SP3GPP (.3gp)
VP8
(Android 2.3.3+)
Streamable only in Android 4.0 and above• WebM (.webm)
• Matroska (.mkv, Android 4.0+)

referenced from:
http://developer.android.com/guide/appendix/media-formats.html#core

[AKM Chip Booster] Audio ADC AK5704 PCB Design

Designing a PCB prototype with AK5704 is not so difficult and I show an example with my design. People who are not familiar with AK5704,...