Remote CameraSource

Tutorials with advanced 'difficulty' and more Lines of Code.

Remote CameraSource

Postby plusminus » Tue Dec 18, 2007 5:00 pm

[align=center]Remote CameraSource[/align]

Tom Gibara, released some public-domain code ('The code is public domain. I make no warranty as to its fitness for any particular purpose.') which can easily be used to connect to a remote WebCam over IP and Port (for example to your Desktop PC).

The Code needed to benefit from his source is really short:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.       CameraSource cs = new RemoteCamera("192.168.0.100", 9889, 320, 240);
  2.  
  3.       if (!cs.open()) { /* deal with failure to obtain camera */ }
  4.  
  5.       while(/*some condition*/) {
  6.  
  7.             cs.capture(canvas); //capture the frame onto the canvas
  8.  
  9.       }
  10.  
  11.       cs.close();
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


On the "Server"-Side you need to run a small app: "WebcamBroadcaster", that makes the Camera-Images available over IP. :)

[align=center]Download the handful of Java-Files on his Page :src: http://www.tomgibara.com/android/camera-source[/align]

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby ryank » Tue Jan 29, 2008 8:50 pm

should something like this be run on a different thread as to not lock up the UI making all the requests for images. Is that the right approach? I have done something similar, not using these classes and it basically freezes the UI.

Also though, I'm not painting a canvas, I am assigning the bitmap to an imageswitcher. Would using the Imageswitcher approach be much slower than painting the canvas?
User avatar
ryank
Developer
Developer
 
Posts: 43
Joined: Mon Jan 28, 2008 3:23 am

Postby plusminus » Wed Jan 30, 2008 12:26 am

Hello ryank,

all extensive work should be outsourced to a thread, because otherwise (as you said) UI would stuck around.

Don't know what will be faster, just give it a try.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby ryank » Wed Jan 30, 2008 2:12 am

this is a dumb question, but where do I get 'canvas' from to pass into the HttpCamera.capture() class? I would like to call it from an OnClick() method but it doesn't seem to recognize Canvas.

thanks again!
User avatar
ryank
Developer
Developer
 
Posts: 43
Joined: Mon Jan 28, 2008 3:23 am

Postby plusminus » Wed Jan 30, 2008 11:08 am

Hello ryank,

this is not my code and I did not yet have a real look on it (+ currently no time to do so :( ).
You could/should contact Tom (link on the top), if you have a code-specific question.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby coding_android » Tue Jul 08, 2008 1:22 pm

Has someone implemented that code and could offer the Source Code for a simple activity that can render the cameras screen.

Is it possible to work with the implemented "http://code.google.com/android/reference/android/media/MediaRecorder.html" in order to record the remote camera? From my point of view I have to set the video source to my remote camera. But I don't know if this is possible.

Even if I use the CameraPreview (with the fake camera) I don't really know how use the extended SurfaceView in my XML layout in order to arrange my layout.
User avatar
coding_android
Moderator
Moderator
 
Posts: 76
Joined: Mon May 05, 2008 10:22 am
Location: Germany

Top

Android Camera Capture

Postby java.padawan » Sun Nov 23, 2008 6:48 pm

java.padawan
Freshman
Freshman
 
Posts: 6
Joined: Mon Oct 27, 2008 7:07 pm

Postby ogi_climb » Tue Dec 16, 2008 1:21 pm

Decoding each frame from InputStream is awfully slow in Android and is impractical - the video quality is bad. It should be read to a buffer at once, and then decoded
ogi_climb
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Dec 16, 2008 1:18 pm

Video Conferencing

Postby chetandl » Thu Mar 19, 2009 1:21 pm

Hi all ,

I want video conferencing to be turned on using my android enabled phone using emulator ?
chetandl
Junior Developer
Junior Developer
 
Posts: 23
Joined: Tue Mar 17, 2009 9:17 am

Postby momob » Fri Aug 21, 2009 5:44 am

Hello guys, (hello PlusMinus)

I have been trying to use the camera on the emulator and I have to admit I am completely at lost (not so surprising since I am a newbie on Android!) I have tried to make sense of the great site:

http://www.tomgibara.com/android/camera-source

But no success. I put those 4 sources codes into a new project but there are many errors that pop up when I tried to compile. I also found the following site:

http://nyatla.jp/nyartoolkit/wiki/index ... Android.en

which seems to use the above site routines. The great thing about this second site is that you can download the all app (which does more than just display the camera view on the emulator) but still it is way over my head and also a lot of errors popup during compile. What I would LOVE will be a simple tutorial based on Tom site which would simply allow visualizing a webcam view (ie: a traffic cam using HTTP address) on the emulator. I maybe the only one but a simple project that allow to show a webcam on the emulator will be a godsend!

Thank you for anybody who will be kind enough to make that project.

Take care all.

Mo.
momob
Junior Developer
Junior Developer
 
Posts: 16
Joined: Mon Jul 13, 2009 8:55 pm

Postby momob » Fri Aug 21, 2009 5:57 am

Hi.

Just to continue my previous post. I am having problem with the following when I tried to compile either links code above:

1- import android.hardware.CameraDevice;


This package may not be available in the 1.5 Android maybe changed recently?


2- public boolean open() {

if (device != null) return true;
device = CameraDevice.open();
if (device == null) return false

"device" is not recognized? I guess CameraDevice not being loaded have something to do with it :)


3- @overide
public int getHeight() {
return height;
}

For some reason I had to delete a huge number of "@overide" in the all code. I am not sure that's right!


As you can see. I am not even close in having something working. I cannot wait to get a real device (that works on Verizon) That will fix a lot of issue in doing apps with the camera. Until then, camera emulator tutorial would be fantastic :D :D
momob
Junior Developer
Junior Developer
 
Posts: 16
Joined: Mon Jul 13, 2009 8:55 pm

Postby momob » Fri Sep 04, 2009 3:17 am

Hi guys,

Just curious. Anybody tried to use Tom's camera emulator code?:

http://www.tomgibara.com/android/camera-source

I am waiting to get my first Android device (probably in October from Verizon) but I would love to experiment right now with the emulator and the camera (an HTTP webcam) for an augmented reality app.

Any pointers or tutorial would be greatly appreciate it.

Thanks!

Mo.
momob
Junior Developer
Junior Developer
 
Posts: 16
Joined: Mon Jul 13, 2009 8:55 pm

Top

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests