B4A Library AndroidVideoCapture - video recorder that is 100% embedded in B4A (6 Jan - new Lib Files in post 48)

Prosg

Active Member
Licensed User
Longtime User
hello,

one of my beta tester have a bug with Samsung Galaxy Core

The error in the google play is :

B4X:
java.lang.RuntimeException: start failed.
at android.media.MediaRecorder.start(Native Method)
at videowrapper.videoWrapper.setStartStopRecording(videoWrapper.java:295)
at com.fitnjob.prosg.mprendrevideo._btnstartend_click(mprendrevideo.java:527)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:4808)
at android.view.View$PerformClick.run(View.java:19918)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5536)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsC+aller.run(ZygoteInit.java:1397)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1192)

Do u have any idea ?

regards
 

Johan Schoeman

Expert
Licensed User
Longtime User
This is where it fails in the library:
mediaRecorder.start();

Seems as if the media recorder was prepared but failed to start. Does your beta tester see a toast message being displayed when it fails?

B4X:
Toast.makeText(BA.applicationContext, "Fail in prepareMediaRecorder()!\n - Ended -", 1).show();
 

Prosg

Active Member
Licensed User
Longtime User
i'm going to ask him.

this msg toast.maketest is automatic i have nothing to do with it ?
 

Prosg

Active Member
Licensed User
Longtime User
he have no toast message

how can i solve this ?

regards
 

Johan Schoeman

Expert
Licensed User
Longtime User
he have no toast message

how can i solve this ?

regards
Try with the attached library files. We need to know if he can at least see this toast message:
"Got to 1"

I have also increased the time for the media recorder to prepare itself from 2 seconds to 3 seconds.
 

Attachments

  • AndroidVideoCaptureLibFilesV1_01.zip
    15.8 KB · Views: 264

Prosg

Active Member
Licensed User
Longtime User
my friend give me the phone, i had test whitout your zip and here is the debugger error


B4X:
mprendrevideo_btnstartend_click (B4A line: 120)
avc1.setStartStopRecording
java.lang.RuntimeException: start failed.
    at android.media.MediaRecorder.start(Native Method)
    at videowrapper.videoWrapper.setStartStopRecording(videoWrapper.java:295)
    at com.fitnjob.prosg.mprendrevideo._btnstartend_click(mprendrevideo.java:665)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:157)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
    at android.view.View.performClick(View.java:4808)
    at android.view.View$PerformClick.run(View.java:19918)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5536)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1397)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1192)

i test with the zip
 

Johan Schoeman

Expert
Licensed User
Longtime User
I don't have a similar device to test it on. I suggest you take the Java code in post #26 and modify/amend it to work for the device that you are having problems with.
 

Prosg

Active Member
Licensed User
Longtime User
bug and i see "Go to 1"

what i have to do ?

'im going to test #26
 

mvpmedia

Member
Licensed User
Longtime User
Are you taking requests?

I need realtime preview and portrait switchability. PLEEEEEEEEASE.
 

mvpmedia

Member
Licensed User
Longtime User
I've spent the last 48 hours trying to figure out your java code with my limited knowledge. it appears your java code is missing back/front camera code. i've tried using the simple library compiler tool exactly the way you posted it and it doesnt have the camera switching capability. can you post your latest code, or help me be able to switch to portrait. Also a realtime preview would be awesome.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Here is the Java code.
 

Attachments

  • TheJavaCode.zip
    8.9 KB · Views: 243

mvpmedia

Member
Licensed User
Longtime User
videoWrapper.java:789: error: cannot find symbol
if (ba.applicationContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY)) {
^
symbol: variable FEATURE_CAMERA_ANY
location: class PackageManager
Note: C:\MyCameraSurfaceView.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

any hints????
 

mvpmedia

Member
Licensed User
Longtime User
is there any way you could just attach a lib that has orientation set at 90 degrees for me, or have it set during init? i can't seem to make this work on my end. I've even trying decompiling and editing the bytecode but nothing works. I've been up for almost 2 days now.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Try with the attached library files.
 

Attachments

  • AndroidVideoCaptureLibFilesPortrait.zip
    15.8 KB · Views: 240

mvpmedia

Member
Licensed User
Longtime User
Thank You! I am much closer to being satisfied how much of a donation would you require to get live video preview into the lib? or should i just use cameraex or another lib to preview?

I sent you a little something.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Thank You! I am much closer to being satisfied how much of a donation would you require to get live video preview into the lib? or should i just use cameraex or another lib to preview?

I sent you a little something.
Thank you for that. I will see if I can amend the code to do a preview prior to starting a recording.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…