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

bbodenmiller picture bbodenmiller · Mar 20, 2012 · Viewed 37.7k times · Source

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.

Answer

bbodenmiller picture bbodenmiller · May 13, 2012

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.