How to replace the Android camera emulation with a video file? - android

It is possible to replace this emulation with a personal video I record ? For example a .mp4 file I captured with a Galaxy S3.
It is possible in eclipse emulator, genymotion, Intel or an other emulator/VM ?
I need this because I have to make some identical tests in an application using the camera. But I can't handle the source because I use a SDK called Metaio.

Emulator uses attached camera to emulate the device camera, so, you can use a fake webcam program with allow you to select the video source, try search for "fake webcam software"

Related

Sample Project for using webcam as camera in android emulator

I've started developing for Android.
I want to write an barcode scanning app, but without a way to activate the camera in the emulator it could be annoying.
Does anybody knows a way to use the USB-Webcam of my PC as an Android Camera ?
I've searched everywhere i know there is a lib from tomgibara, but it would be really nice if some has got an sample project for this.
At the moment the Emulator only asks for the capturing device, but when i start now the camera app from android i only see this dummy camera site with this chessy squares.
Thank you for all of your help.
You can specify which camera to use and how in the emulator command line using the options
-fake-camera <mode> set fake camera emulation mode
where mode can be one of back, front, or off, and
-webcam name=<name>[,dir=<direction>] setup web camera emulation
where name is a valid connected camera name and dir is one of front or back.
The connected camera names can be obtained by using the special option -webcam list.
For example, in Linux you can obtain something like
List of web cameras connected to the computer:
Camera 'webcam0' is connected to device '/dev/video0' on channel 0 using pixel format 'YUYV'
OK after some tries I am able to run the emulator on the way you described above, but the fake-camera option does not help =(
It let me choose which camera I want use and after i clicked "OK" the emulator starts, but without the webcam as front or back camera =(
Is it possible that it is a webcam which is not supported ?
If Yes: which cameras are supported ?

Camera in android emulator

I use android SDK 4.0.3 and eclipse Indigo and I'm trying to develop an application which uses a camera. When I take a photo, this message appears:
Unfortunately, camera has stopped.
In the eclipse console:
emulator: ERROR: _camera_client_query_frame: Unable to obtain first video frame from the camera '/dev/video0' in 2009 milliseconds: Resource temporarily unavailable.
My OS is Debian Squeeze. What can I do? Thanks.
In emulator camera does not work properly .You must try it on Real Device.
As Shahzad imam said, you can't use camera on emulator.
But if can't buy real device and you're really need camera you can try to translate video to network from your PC and then handle it in Android, as it a real camera. Or, if you just need photo, you can use some picture instead.

Video Capturing in Emulator?

I am trying to capture the video on emulator with 2.1 sdk on windows. I am using Eclipse. Is it possible to capture the video in the emulator?
No, it's impossible to use camera on emulator.
But you can set up camera on your computer to broadcast into network, and then connect in your Android app and get video.

Webcam for testing camera in Android AVD?

Can I use my webcam connected to the AVD for testing camera and its functionality?
I have read in some articles that Android 3.0 + supports this feature.Is it possible?
I also receive a connect cam dialog box when my webcam is connected, when I start my AVD.
Using Eclipse.
AVD Manager
Edit the AVD.
Hardware > New:
Configures camera facing backwards = "webcam0" (use dropdown).
Run project using that AVD.
Its some tricky way either its work or not I don't know...
But you can try it, Look at How to use web camera in android emulator to capture a live image?
Live camera preview in the Android emulator
Live Camera Previews in Android

Camera on Android Eclipse emulator:

I don't have an embedded camera in the lid of my notebook. I'd be hooking up through an external USB camera.
The emulator runtime can pick this up right? I'll get the image displayed inside the AVD skin's screen in real time?
In the current release of the emulator (Ice Cream Sandwich, API14;Linux), web camera support is available. Google's documentation and most answers available on the web do not yet reflect this. The emulator itself does:
emulator -help
...
-fake-camera <mode> set fake camera emulation mode
-webcam name=<name>[,dir=<direction>] setup web camera emulation
...
emulator -help-all
and further:
help for option -fake_camera
Use -fake-camera <mode> to control fake camera emulation.
Valid values for <mode> are:
off -> disable fake camera emulation
back -> fake camera is facing back
front -> fake camera is facing front
help for option -webcam
-webcam off to disable web camera emulation.
-webcam list to list web cameras available for emulation.
-webcam name=[,dir=<direction>] to setup parameters for web camera emulation.
<name> platform-independent name identifying emulated camera device.
<direction> defines direction the camera is facing. Valid values are:
front -> emulate camera as facing front
back -> emulate camera as facing back
Default direction value for emulated web camera is 'front'
Afaik the emulator wont show a realtime camera regardless.
If you need a live camera-source to use in your own app for debugging, there is a sollution at
http://www.tomgibara.com/android/camera-source
Updated for newer android versions:
http://www.inter-fuser.com/2009/09/live-camera-preview-in-android-emulator.html
Time to upgrade your ADK!
As of Android SDK version 14, the emulator supports webcams to simulate a camera:
General notes - Added webcam support to Android 4.0 or later platforms to emulate rear-facing cameras when one webcam is present, and to emulate both rear-facing and front-facing cameras when two webcams are present. Webcam suport is for Windows and Linux only. Mac support will come in a later release.
from: Android SDK Tools, SDK Tools, Revision 14
It works! I've tried this myself.
From the android documentation:
Emulator Limitations
In this release, the limitations of
the emulator include:
...
No support for camera/video capture
...
In other words, no, you cannot access or preview the camera in the emulator.

Categories

Resources