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
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With