Sunday, December 12, 2010

Camera Bot

Some days have passed now, and I spent some time on the video streaming. Well more like "image streaming". As it turns out, android is not streaming friendly yet. With the release of 2.3 they already support audio streaming to the device. Streaming from the device to a server however is a different story. The typical video containers which are supported are 3gp and mp4. There is actually no streaming container implemented. The problem with both of these containers is that the header and meta data is written to a file only after the recording is done. So I could stream the raw data to my server but without the additional information it's worth nothing. There are some workarounds like implementing custom video containers of your own, but that's too much effort for my timeframe. Another workaround would be to save the video to a small file transmit it to the server which can process it and do the whole thing in a loop. The latency would be too big to be useful.

The whole platform restrictions and workarounds are described in a diploma thesis which I found while researching. There are app providers which promote video conferencing apps but as the platform doesn't support streaming naturally, my guess is that it had to be implemented in a workaround.

I used the approach of transmitting single snapshot images from the camera which I could stream over a socketconnection. On the server side I extended my JSF application with components from ICEfaces and PrimeFaces. I used the DynaImage from PrimeFaces which can handle streamed content. For updating the image periodically I used ICEfaces Ajax Push mechanism.

The server and client applications still have to be tweaked to avoid crashes and to provide a faster image update, but here is a first impression on the result. Yeah I know the tab is oversized for the robot but it's my only android device :).




  2. I'm trying to get my android-nxt bluethoot connection to work, but I cant... Can you send me a example of sending a simple message to the nxt and let the nxt send one back? I would be very grateful! Email:

    1. Sorry for the very late answer. I didn't recognize this post somehow. The MINDroid project is provided by LEGO and NXT and shows how to communicate with the NXT via Android.
      I modified it for my use case but that's the place to look.

  3. Dear Mario:

    Is it possible to share this course code with me? thank you!!


    1. Sorry I don't think that I have the code for this anymore. It was just a simple proof of concept which I didn't develop further.
      However I can give you a hint where to look for more information. I took the MINDroid code stripped it down to the most basic parts which I needed and then I wrote the server component. The MINDroid project is provided by LEGO and NXT and shows how to communicate with the NXT via Android.