views:

1930

answers:

2

Due to a series of bizarre events, I am in the middle of a project targeting mobile phones (more like pocket PCs). I have searched far and wide, but couldn't find a way to (reliably) access the front camera on any platform (I've tried Android, J2ME and Windows Mobile), let alone capture video from said camera.

Can anyone provide any insight on how to achieve this on Windows Mobile, Symbian/J2ME, or any other platform?

Edit: I've tried searching the API Documentation, but it doesn't mention the front camera.

A: 

I was doing some tinkering with this about a year ago and Windows Mobile provides a camera capture API for both still and video. All with samples that conveniently come with the mobile SDK.

Edit: I know it says mobile 6.0 but it is also available in mobile 5.0

Kevin Loney
+1  A: 

I did it in both J2ME and Symbian (S60). For a Symbian example check this example (you might need to register to forum Nokia), in order to use the front camera simply initialize using camera index 1 (index 0 is the back camera):

m_pCamera = CCamera::NewL(*this, 1)

Although make sure that the device does have a front camera using CCamera::CamerasAvailable() (if it has a front camera and a back camera then that call will return 2).

For J2ME check out this example from the SDN, instead of initializing the default camera (the back camera) like this:

mPlayer = Manager.createPlayer("capture://video");

You simply need to initialize the front camera:

mPlayer = Manager.createPlayer("capture://devcam1");

Enjoy!

dudico
How does one capture the frames in Symbian C++?I already know how to do it in J2ME (get a VideoControl, take screenshots/snapshots from that), but I'd like to try C++ [for performance reasons -- this IS mobile development, after all =)]
Remoun
The example i added shows how to do that. Basically, You need to call StartVideoCaptureL and then you'll get the frames in the FrameBufferReady callback. But please for your own sake take a look at the example I referred to.
dudico
The tutorial only mentions the capture of still images. How do I capture a video (with sound preferably) using the API?
futureelite7
Check out the following example code, for video recording on Symbian:http://www.forum.nokia.com/info/sw.nokia.com/id/48d38e98-2b78-4da8-b111-63e9c7d34feb/S60_Platform_Video_Example_v2_0_en.zip.html
dudico