Closed sdubey0201 closed 5 years ago
Mine crashes too, seems like it runs out of memory??? Device is Nexus 4 with Android 5.0.1
04-12 18:14:10.876 6643-6643/com.example.android.camera2video I/art﹕ Late-enabling -Xcheck:jni
04-12 18:14:11.067 6643-6671/com.example.android.camera2video D/OpenGLRenderer﹕ Render dirty regions requested: true
04-12 18:14:11.074 6643-6643/com.example.android.camera2video D/Atlas﹕ Validating map...
04-12 18:14:11.144 6643-6671/com.example.android.camera2video I/Adreno-EGL﹕
Same here, Nexus 4, Android 5.1
Hey Hantc, check my PR: https://github.com/googlesamples/android-Camera2Video/pull/6
Its based on a fix from someone over on the Xamarin port. Works for me on the Nexus 4 on 5.1 :)
Many thanks! Works. I tried to fix it by myself (according to xamarin fix), but as I'm new in this technology so I wasn't able to:)
2015-04-24 8:57 GMT+02:00 madhavajay notifications@github.com:
Hey Hantc, check my PR:
6 https://github.com/googlesamples/android-Camera2Video/pull/6
Its based on a fix from someone over on the Xamarin port. Works for me on the Nexus 4 on 5.1 :)
— Reply to this email directly or view it on GitHub https://github.com/googlesamples/android-Camera2Video/issues/5#issuecomment-95824393 .
No problems! :) Good luck.
I think the description of the stop()
method does mean something. Perhaps the reason it crashes is that no valid audio/video data received, which is also why there's empty output file ? Do you not get empty output file ? @madhavajay
Stops recording. Call this after start(). Once recording is stopped,
* you will have to configure it again as if it has just been constructed.
* Note that a RuntimeException is intentionally thrown to the
* application, if no valid audio/video data has been received when stop()
* is called. This happens if stop() is called immediately after
* start(). The failure lets the application take action accordingly to
* clean up the output file (delete the output file, for instance), since
* the output file is not properly constructed when this happens.
*
* @throws IllegalStateException if it is called before start()
check out this stackoverflow answer worked for me
For those who are getting SurfaceAbandonedException just remove the mMediaRecorder.stop() / mMediaRecorder.release(); from the stopRecordingVideo() method. The mediaplayer causes the surface to destroy and leading to app crash
This sample has been migrated to a new location where we can accept Pull Requests (check README for more information).
As recommended by GitHub, we are closing all issues and pull requests now that this older repo will be archived.
If you still see this issue in the updated repo, please reopen the issue/PR there. Thank you!
following error :
MediaRecorder﹕ start called in an invalid state: 4 MediaRecorder﹕ stop called in an invalid state: 4 com.example.android.camera2video E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.example.android.camera2video, PID: 2420 java.lang.IllegalStateException at android.media.MediaRecorder.stop(Native Method) at com.example.android.camera2video.Camera2VideoFragment.stopRecordingVideo(Camera2VideoFragment.java:536) at com.example.android.camera2video.Camera2VideoFragment.onClick(Camera2VideoFragment.java:292) at android.view.View.performClick(View.java:4756) at android.view.View$PerformClick.run(View.java:19749) 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:5221) 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:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)