Comments (8)
That's really bizarre. The color format is set 10 lines before the crash. What device and OS version? Can you enable the VERBOSE logging in VideoEncoderCore -- I'd like to see what comes out of the "format" log message on line 73.
from grafika.
It appeared both in Nexus 4 with 4.4.2 and in Moto X with 4.3 .
I'll try with verbose logging and i'll post in a bit.
This is the verbose log from the crash. Tested on Nexus 4 with 4.4.2. In my Nexus 7 with 4.3 it seems to work without a crash though.
03-28 18:23:00.388: D/dalvikvm(1232): Late-enabling CheckJNI
03-28 18:23:00.484: D/Grafika(1232): Can't find readable /data/data/com.android.grafika/files/gen-eight-rects.mp4
03-28 18:23:00.516: D/libEGL(1232): loaded /system/lib/egl/libEGL_genymotion.so
03-28 18:23:00.516: D/(1232): HostConnection::get() New Host Connection established 0xb9717678, tid 1232
03-28 18:23:00.528: D/libEGL(1232): loaded /system/lib/egl/libGLESv1_CM_genymotion.so
03-28 18:23:00.528: D/libEGL(1232): loaded /system/lib/egl/libGLESv2_genymotion.so
03-28 18:23:00.564: W/EGL_genymotion(1232): eglSurfaceAttrib not implemented
03-28 18:23:00.564: E/OpenGLRenderer(1232): Getting MAX_TEXTURE_SIZE from GradienCache
03-28 18:23:00.568: E/OpenGLRenderer(1232): Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
03-28 18:23:00.568: D/OpenGLRenderer(1232): Enabling debug mode 0
03-28 18:23:08.720: D/Grafika(1232): onCreate complete: com.android.grafika.CameraCaptureActivity@529af168
03-28 18:23:08.720: D/Grafika(1232): onResume -- acquiring camera
03-28 18:23:08.768: W/Grafika(1232): Unable to set preview size to 1280x720
03-28 18:23:08.772: D/Grafika(1232): onResume complete: com.android.grafika.CameraCaptureActivity@529af168
03-28 18:23:08.772: D/Grafika(1232): setCameraPreviewSize
03-28 18:23:08.816: W/EGL_genymotion(1232): eglSurfaceAttrib not implemented
03-28 18:23:08.832: D/(1232): HostConnection::get() New Host Connection established 0xb981fb58, tid 1252
03-28 18:23:08.920: D/Grafika(1232): onSurfaceCreated
03-28 18:23:08.944: D/Grafika(1232): Created program 3 (TEXTURE_EXT)
03-28 18:23:08.948: D/Grafika(1232): onSurfaceChanged 984x1317
03-28 18:23:08.952: D/Grafika(1232): Updating filter to 0
03-28 18:23:08.960: D/Grafika(1232): onItemSelected: 0
03-28 18:23:09.040: D/Grafika(1232): CameraHandler [Handler (com.android.grafika.CameraCaptureActivity$CameraHandler) {529f10dc}]: what=0
03-28 18:23:09.092: D/(1232): HostConnection::get() New Host Connection established 0xb979e2e0, tid 1243
03-28 18:23:09.212: D/(1232): HostConnection::get() New Host Connection established 0xb98274d0, tid 1244
03-28 18:23:50.340: D/Grafika(1232): changeRecordingState: was false now true
03-28 18:23:50.368: D/Grafika(1232): START recording
03-28 18:23:50.368: D/Grafika(1232): Encoder: startRecording()
03-28 18:23:50.368: D/Grafika(1232): handleStartRecording EncoderConfig: 640x480 @1000000 to '/data/data/com.android.grafika/files/camera-test.mp4' ctxt=android.opengl.EGLContext@b9847c60
03-28 18:23:50.368: D/Grafika(1232): format: {frame-rate=30, bitrate=1000000, height=480, mime=video/avc, color-format=2130708361, i-frame-interval=5, width=640}
03-28 18:23:50.368: I/OMXClient(1232): Using client-side OMX mux.
03-28 18:23:50.404: I/SoftAVCEncoder(1232): Construct SoftAVCEncoder
03-28 18:23:50.408: I/ACodec(1232): setupVideoEncoder succeeded
03-28 18:23:50.408: E/OMXNodeInstance(1232): createInputSurface requires AndroidOpaque color format
03-28 18:23:50.408: E/ACodec(1232): [OMX.google.h264.encoder] onCreateInputSurface returning error -38
03-28 18:23:50.408: W/MediaCodec(1232): createInputSurface failed, err=-38
03-28 18:23:50.408: W/dalvikvm(1232): threadid=12: thread exiting with uncaught exception (group=0xa4c1e648)
03-28 18:23:50.412: E/AndroidRuntime(1232): FATAL EXCEPTION: TextureMovieEncoder
03-28 18:23:50.412: E/AndroidRuntime(1232): java.lang.IllegalStateException
03-28 18:23:50.412: E/AndroidRuntime(1232): at android.media.MediaCodec.createInputSurface(Native Method)
03-28 18:23:50.412: E/AndroidRuntime(1232): at com.android.grafika.VideoEncoderCore.<init>(VideoEncoderCore.java:79)
03-28 18:23:50.412: E/AndroidRuntime(1232): at com.android.grafika.TextureMovieEncoder.prepareEncoder(TextureMovieEncoder.java:381)
03-28 18:23:50.412: E/AndroidRuntime(1232): at com.android.grafika.TextureMovieEncoder.handleStartRecording(TextureMovieEncoder.java:312)
03-28 18:23:50.412: E/AndroidRuntime(1232): at com.android.grafika.TextureMovieEncoder.access$0(TextureMovieEncoder.java:309)
03-28 18:23:50.412: E/AndroidRuntime(1232): at com.android.grafika.TextureMovieEncoder$EncoderHandler.handleMessage(TextureMovieEncoder.java:281)
03-28 18:23:50.412: E/AndroidRuntime(1232): at android.os.Handler.dispatchMessage(Handler.java:99)
03-28 18:23:50.412: E/AndroidRuntime(1232): at android.os.Looper.loop(Looper.java:137)
03-28 18:23:50.412: E/AndroidRuntime(1232): at com.android.grafika.TextureMovieEncoder.run(TextureMovieEncoder.java:248)
03-28 18:23:50.412: E/AndroidRuntime(1232): at java.lang.Thread.run(Thread.java:841)
03-28 18:23:50.660: D/Grafika(1232): onPause -- releasing camera
03-28 18:23:50.680: D/Grafika(1232): releaseCamera -- done
03-28 18:23:50.696: D/Grafika(1232): renderer pausing -- releasing SurfaceTexture
03-28 18:23:50.696: D/Grafika(1232): onPause complete
03-28 18:23:50.820: W/EGL_genymotion(1232): eglSurfaceAttrib not implemented
03-28 18:23:51.228: D/Grafika(1232): onDestroy
from grafika.
The problem is this:
I/SoftAVCEncoder(1232): Construct SoftAVCEncoder
For some reason you're getting the software AVC codec rather than the hardware-accelerated implementation. The software codec doesn't support input from surfaces. That's going to prevent a number of things from working, including the movie generation (which might be related to the other bug you filed).
My guess would be that something running in the background is using all available hardware encoder resources. I don't know an easy way to figure out what.
Since this is affecting multiple devices it could be something that you have installed or run on them. I've run Grafika on N4, N5, N7(2012/2013), N10, Galaxy Nexus, Moto X, and my wife's Galaxy S4, and haven't encountered any problems, but I have very few Play Store apps installed on them. I down-revved my N4 just now and didn't see a failure.
from grafika.
I'm closing these since they seem to be related to some of my devices. :) I'll comment if I find out what is causing the usage of software encoder.
from grafika.
I'll add "to do" items to handle the failures better. Crashing mysteriously is Bad (even for Grafika, which makes few claims to robustness).
from grafika.
Hi all,
I have this issue, too. Asus fonepad 4.2.2.
And my workaround is same as uberspot's comment.
finally, thx your effort to build this project, it indeeds help me to learn the MediaCodec's application.
from grafika.
If you're running Android 4.2.2, the surface-input feature doesn't exist at all (it was added in 4.3 / API 18).
AFAIK Grafika won't work on any of the emulators, as all of them rely on the software codecs.
from grafika.
I got it ! thx for your reply
from grafika.
Related Issues (20)
- Extend encode/decode test example with asynchronous API
- Sound not available in Video using CameraCaptureActivity HOT 1
- how can i remove shape HOT 1
- how can i add shapes in texture view using open gl
- glReadPixels returns a blank image on disabling blend
- Decoding four video streams simultaneous on Google Pixel 2 phone
- seconds of video in Continuous Capture mode becomes double after keeping it on for a while. HOT 3
- If you want to record mp4 with sound, use this one https://github.com/moo611/OpenCamera
- Memory leak of Texture2dProgram
- Continuous capture bug(Android5.1.1) HOT 1
- Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x38 in tid 9379, pid 9379
- Some OpenGL stuff doesn't work on some devices: eglMakeCurrent failed and glDrawArrays: glError 0x505 HOT 4
- How to show front and back camera simultaneously? HOT 5
- Can we play scene.json in grafika?
- Test HOT 1
- Doesn't build on Flamingo and Giraffe HOT 2
- fun fact HOT 1
- Draw bitmap on frame (GLES) HOT 3
- MediaCodec + Camera2
- RecordFBOActivity swapBuffers problem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grafika.