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

浪子不回头ぞ 提交于 2019-12-20 09:02:22

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/9784683/android-external-camera-options-overlay-on-top-of-video-stream-no-middleman-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!