Open NEO-LION opened 1 year ago
应该还有其他的错误日志吧,我看这个截图,录像功能初始化应该没有成功
--------- beginning of main
2023-08-17 17:16:04.711 19295-19327 [Gralloc] com.herohan.uvcdemo I Got handle 3 for fd 63
2023-08-17 17:16:04.711 19295-19327 [Gralloc] com.herohan.uvcdemo I leave, w : 1200, h : 1920, format : 0x1,internal_format : 0x1, usage : 0xb00. size=9216000,pixel_stride=1200,byte_stride=4800
2023-08-17 17:16:04.711 19295-19327 [Gralloc] com.herohan.uvcdemo I leave: prime_fd=63,share_attr_fd=64
--------- beginning of system
2023-08-17 17:16:04.745 504-4479 ActivityManager system_process E getPackageFerformanceMode--ComponentInfo{com.herohan.uvcdemo/com.herohan.uvcdemo.RecordVideoActivity}----com.herohan.uvcdemo
2023-08-17 17:16:04.751 19295-19327 [Gralloc] com.herohan.uvcdemo I Got handle 4 for fd 67
2023-08-17 17:16:04.751 19295-19327 [Gralloc] com.herohan.uvcdemo I leave, w : 1200, h : 1920, format : 0x1,internal_format : 0x1, usage : 0xb00. size=9216000,pixel_stride=1200,byte_stride=4800
2023-08-17 17:16:04.751 19295-19327 [Gralloc] com.herohan.uvcdemo I leave: prime_fd=67,share_attr_fd=68
2023-08-17 17:16:04.764 504-4479 ActivityManager system_process E getPackageFerformanceMode--ComponentInfo{com.herohan.uvcdemo/com.herohan.uvcdemo.RecordVideoActivity}----com.herohan.uvcdemo
2023-08-17 17:16:04.866 19295-19295 BasicPreviewActivity com.herohan.uvcdemo D initCameraHelper:
2023-08-17 17:16:04.867 19295-19295 CameraHelper com.herohan.uvcdemo D Constructor:
2023-08-17 17:16:04.873 19295-19295 USBMonitor com.herohan.uvcdemo V USBMonitor:Constructor
2023-08-17 17:16:04.877 19295-19295 USBMonitor com.herohan.uvcdemo V USBMonitor:mUsbManager=android.hardware.usb.UsbManager@9800342
2023-08-17 17:16:04.877 19295-19295 CameraHelper com.herohan.uvcdemo D registerCallback:
2023-08-17 17:16:04.877 19295-19295 CameraConnectionService com.herohan.uvcdemo D mUSBMonitor#register:
2023-08-17 17:16:04.879 19295-19295 USBMonitor com.herohan.uvcdemo I register:
2023-08-17 17:16:04.953 19295-19327 mali_winsys com.herohan.uvcdemo D EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface , egl_color_buffer_format *, EGLBoolean) returns 0x3000
2023-08-17 17:16:04.974 19295-19295 CameraHelper com.herohan.uvcdemo D addSurface:surface=Surface(name=null)/@0x77fb5cb,isRecordable=false
2023-08-17 17:16:05.023 19295-19327 [Gralloc] com.herohan.uvcdemo I Got handle 5 for fd 78
2023-08-17 17:16:05.023 19295-19327 [Gralloc] com.herohan.uvcdemo I leave, w : 1200, h : 1920, format : 0x1,internal_format : 0x1, usage : 0xb00. size=9216000,pixel_stride=1200,byte_stride=4800
2023-08-17 17:16:05.023 19295-19327 [Gralloc] com.herohan.uvcdemo I leave: prime_fd=78,share_attr_fd=79
2023-08-17 17:16:05.057 19295-19391 USBMonitor com.herohan.uvcdemo D DeviceCheckRunnable onAttach:device=/dev/bus/usb/002/005
2023-08-17 17:16:05.057 19295-19391 CameraConnectionService com.herohan.uvcdemo D OnDeviceConnectListener#onAttach:
2023-08-17 17:16:05.058 19295-19391 CameraHelper com.herohan.uvcdemo D onAttach:
2023-08-17 17:16:05.058 19295-19306 zygote64 com.herohan.uvcdemo I Do partial code cache collection, code=52KB, data=52KB
2023-08-17 17:16:05.058 19295-19391 USBMonitor com.herohan.uvcdemo D DeviceCheckRunnable onAttach:device=/dev/bus/usb/001/003
2023-08-17 17:16:05.058 19295-19391 CameraConnectionService com.herohan.uvcdemo D OnDeviceConnectListener#onAttach:
2023-08-17 17:16:05.059 19295-19391 CameraHelper com.herohan.uvcdemo D onAttach:
2023-08-17 17:16:05.060 19295-19306 zygote64 com.herohan.uvcdemo I After code cache collection, code=52KB, data=52KB
2023-08-17 17:16:05.060 19295-19306 zygote64 com.herohan.uvcdemo I Increasing code cache capacity to 256KB
2023-08-17 17:16:05.063 19295-19306 zygote64 com.herohan.uvcdemo I Compiler allocated 7MB to compile void android.widget.TextView.
我看错误日志,是MediaCodec的底层驱动(OMX.rk.video_encoder.avc)报错了,你把分辨率参数设置低一点,再录像试试,现在分辨率(2592,1944)@Mjpeg有点高,有可能底层驱动不支持编码这么高的图像数据
谢谢
点击录像功能会崩溃
FATAL EXCEPTION: VideoCaptureaudio encoding thread
Process: com.herohan.uvcdemo, PID: 14018
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.media.MediaMuxer.addTrack(android.media.MediaFormat)' on a null object reference
at com.herohan.uvcapp.VideoCapture.audioEncode(VideoCapture.java:903)
at com.herohan.uvcapp.VideoCapture.lambda$startRecording$0$com-herohan-uvcapp-VideoCapture(VideoCapture.java:430)
at com.herohan.uvcapp.VideoCapture$$ExternalSyntheticLambda0.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)