5

I'm using the SL4A platform on an android 4.0 tablet and attempting to initialize a webcam stream using the droid.webcamStart() method found here: http://code.google.com/p/android-scripting/wiki/ApiReference#webcamStart my problem is when I execute the following code I get a setParameters failed error.

The python code is simple:

 import android
 droid = android.Android()
 address = droid.webcamStart(100,80,0).result

if all goes according to plan this should initialize a webcam preview stream but instead I am getting an error stating:

 java.lang.RuntimeException: setParameters failed

I've seen other posts somewhat related to this same issue however the developers were using java for development, not python. What can I do to fix this issue in python?

Thanks

sadmicrowave
  • 39,964
  • 34
  • 108
  • 180
  • What cameras do you have on your tablet? It looks like SL4A only supports the default back facing camera, so if you don't have one it will fail. – Duncan Jan 08 '13 at 14:23
  • I have a front and back facing camera on the tablet. I'm about to try an HTC Evo as well and see if I can get anywhere with that... – sadmicrowave Jan 13 '13 at 18:00

1 Answers1

1

It could be because your device doesn't support the preview format that is being set in openCamera method of WebcamFacade.java at SL4A.

I have changed it by ImageFormat.NV21 that according with Android docs is always supported and it worked for me!

You can download this change from here:

https://code.google.com/r/olapaola-android-scripting/

Paola G
  • 798
  • 1
  • 6
  • 13