Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android external camera options - overlay on top of video stream, no middleman server/router

I'm looking for a way to interface with an external camera from an Android device. The reason it needs to be an external camera is because I need to be able to modify the camera (remove IR filter) and I have no desire to break an on-board phone camera.

It doesn't matter how the camera connects whether it is through USB, bluetooth, WiFi, or some other communication protocol, the two devices just need to be able to talk without having a middleman server/router.

I'm looking for a solution that:

  • Doesn't require rooting or rebuilding Android/the Linux Kernel (absolute must)
  • Allows me to overlay items over the image/video (good)
  • Access the video stream to do image analysis (best)

The last requirement isn't required but would be nice.

Options I have explored:

  • USB camera: rebuilt Linux Kernel as per http://brain.cc.kogakuin.ac.jp/research/usb-e.html and tried using provided code using camera: http://www.amazon.com/gp/product/B002X3VEIE/ref=oh_o02_s00_i00_details. Did not work in the slightest bit. I later learned that the author used the CM9 mod however this really isn't an option given that it isn't practical for an app in the market.
  • Bluetooth camera: Looxcie and CountourGPS look like the best options however the feed is streamed to their app and they have no API or SDK so how can one overlay on their video feed?
  • IP camera: to me this looks like the most promising option but how can one access an IP cameras video feed without a middleman server/router? GoPro HD Hero2 with WiFi BacPac looks potentially promising but it isn't out yet and from what I can tell requires you to use their app similar to the bluetooth camera options. What cameras exist that allow me to connect to them and receive a direct video feed and how do I go about this programmatically?

If connection to an IP camera without the middleman is possible the code at Android and MJPEG and Getting IP Cam video stream on Android (MJEPG) looks promising.

Can I overlay on top of another apps video feed? Is it possible to connect directly to an IP camera? Any suggested options greatly appreciated.

like image 352
bbodenmiller Avatar asked Mar 20 '12 10:03

bbodenmiller


2 Answers

I ended up opting for the IP camera option as it seemed to be the only viable option.

I was able to purchase this camera and remove the IR filter by removing the glue at the base of the lens and then breaking the IR filter out.

I was able to connect the camera to ICS using the AndroidAP hotspot and to older Android devices using an ad-hoc network setup on the camera (you have to manually set IP addresses, etc for ad-hoc and it's a pain).

As for getting MJPEG working in an app on ICS I made these modifications to the code I found on SO.

Lastly the app needs to be able to turn the AP on and off which I have not finished yet but here is some code to start with.

like image 106
bbodenmiller Avatar answered Nov 01 '22 16:11

bbodenmiller


In answer to your options..

Looxcie has a onboard buffer that could potentially be tapped into, ContourGPS does not have a buffer to the best of my knowledge. Unfortunately bluetooth isn't very viable for live video/recording. They also don't publicize their bluetooth stack or communications. There are methods to "decrypt" or find out how they communicate but it would be time consuming.

Your best option is to use an IP Camera. You can use WiFi Direct, or you can use the phones tethering app. (Android is probably best). Then connect the IP Camera to the tethering app and you're all settled. Contour has a new camera that does HDMI. Then they also have a livestreamer. http://contour.com/products/live-streaming-cerevo-liveshell

The IP Method is expensive but it is a decent way to get the result that you want.

like image 4
Chris Timberlake Avatar answered Nov 01 '22 16:11

Chris Timberlake