android摄像头能录像但不保存

~未来可期~ 2017-10-09 02:59:28
问题:Android7.1使用1600万摄像头能录像,但点击停止录像时录像文件并没有保存,apk使用的是系统自带的。但使用第三方apk是录像时能保存的;
抓取log发现MPEG4Writer的video轨迹线程count计数为0--》MPEG4Writer: Received total/0-length (0/0) buffers and encoded 0 frames. - Video
部分log如下:
01-01 18:25:17.005 22154 22154 V CAM_VideoModule: stopVideoRecording.
01-01 18:25:17.007 2822 2939 I vol.Events: writeEvent external_ringer_mode_changed normal
01-01 18:25:17.009 2690 13845 D ZenLog : set_ringer_mode_external: com.android.camera2,e:silent->normal,i:silent->normal
01-01 18:25:17.015 2822 2939 I vol.Events: writeEvent mute_changed STREAM_RING false
01-01 18:25:17.015 2690 2690 D ZenLog : set_zen_mode: off,ringerModeExternal
01-01 18:25:17.018 2822 2939 I vol.Events: writeEvent mute_changed STREAM_SYSTEM false
01-01 18:25:17.018 2822 2939 I vol.Events: writeEvent internal_ringer_mode_changed normal
01-01 18:25:17.023 2378 2952 D MPEG4Writer: Video track stopping
01-01 18:25:17.023 2378 2952 D MPEG4Writer: Video track source stopping
01-01 18:25:17.023 2378 26593 I MediaCodecSource: encoder (video) stopping
01-01 18:25:17.030 2822 2939 I vol.Events: writeEvent zen_mode_changed off
01-01 18:25:17.102 2378 26617 E MPEG4Writer: The number of recorded samples is 0
01-01 18:25:17.103 2375 26598 I EXYNOS_BASE_COMP: [0xf6742680][Exynos_OMX_ComponentStateSet] current:(OMX_StateExecuting) dest:(OMX_StateIdle)
01-01 18:25:17.103 2378 26617 W MPEG4Writer: 0-duration samples found: 1
01-01 18:25:17.103 2375 26598 I EXYNOS_BASE_COMP: [0xf6742680][Exynos_OMX_ComponentStateSet]:567 OMX_EventCmdComplete
01-01 18:25:17.103 2378 26617 W MPEG4Writer: 0-duration samples found: 1
01-01 18:25:17.103 2378 26617 I MPEG4Writer: Received total/0-length (0/0) buffers and encoded 0 frames. - Video
01-01 18:25:17.104 2375 26598 I EXYNOS_BASE_COMP: [0xf6742680][Exynos_OMX_ComponentStateSet] current:(OMX_StateIdle) dest:(OMX_StateLoaded)
01-01 18:25:17.136 2375 26598 I EXYNOS_BASE_COMP: [0xf6742680][Exynos_OMX_ComponentStateSet]:567 OMX_EventCmdComplete
01-01 18:25:17.138 2378 26593 I MediaCodecSource: encoder (video) stopped
01-01 18:25:17.138 2378 26614 D CameraSource: reset: E
01-01 18:25:17.139 2365 3623 I ExynosCameraInterface: INFO(HAL_camera_device_stop_recording[1470]):camera(0) in
01-01 18:25:17.139 2365 3623 D ExynosCameraInterface: DEBUG(check_camera_state):camera(0) state(7) checking...
01-01 18:25:17.139 2365 3623 D ExynosCameraInterface: DEBUG(check_camera_state):camera(0) state(6:RECORDING_RUNNING->7:RECORDING_STOPPED) is valid
01-01 18:25:17.139 2365 3623 I ExynosCameraGed: [CAM_ID(0)][]-INFO(stopRecording[1148])
01-01 18:25:17.139 2365 26616 W ExynosCameraGed: [CAM_ID(0)][]-WARN(m_recordingThreadFunc[2855]):wait timeout
01-01 18:25:17.139 2365 3623 D ExynosCamera: [CAM_ID(0)][]-DEBUG(m_clearList):remaining frame(0), we remove them all
01-01 18:25:17.139 2365 3623 D ExynosCamera: [CAM_ID(0)][]-DEBUG(m_clearList):EXIT
01-01 18:25:17.139 2365 3623 D ExynosCamera: [CAM_ID(0)][]-DEBUG(m_enableFaceDetection[3984]) toggle : 1
01-01 18:25:17.139 2365 3623 D ExynosCamera: [CAM_ID(0)][]-DEBUG(m_enableFaceDetection[3984]) toggle : 0
01-01 18:25:17.140 2365 3623 I ExynosCameraActivityAutofocus: INFO(setRecordingHint[320]):hint(0)
01-01 18:25:17.140 2365 3623 I ExynosCameraInterface: INFO(HAL_camera_device_stop_recording[1482]):camera(0) out from stopRecording()
01-01 18:25:17.140 2365 3623 I ExynosCameraInterface: INFO(HAL_camera_device_stop_recording[1486]):camera(0) unlocked..
01-01 18:25:17.140 2365 3623 I ExynosCameraInterface: INFO(HAL_camera_device_stop_recording[1491]):camera(0) out
01-01 18:25:17.140 2365 3623 D ExynosCameraInterface: DEBUG:duration time( 1 msec):(HAL_camera_device_stop_recording)
01-01 18:25:17.140 2370 26609 W AudioPolicyIntefaceImpl: getOutputForAttr uid 1047 tried to pass itself off as 1000
01-01 18:25:17.141 2370 2775 W AudioFlinger: TrackBase uid 1047 tried to pass itself off as 1000
01-01 18:25:17.142 2370 2706 D audio_hw_primary: fast_out-set_audio_route: [PLAYBACK] current-device(none) new-device(speaker) in cur-mode(none) & new-mode(normal)!
01-01 18:25:17.143 2378 26614 D CameraSource: reset: X
01-01 18:25:17.143 2378 2952 D MPEG4Writer: Video track source stopped
01-01 18:25:17.143 2378 2952 D MPEG4Writer: Video track stopped
01-01 18:25:17.143 2378 2952 D MPEG4Writer: Audio track stopping
01-01 18:25:17.143 2378 2952 D MPEG4Writer: Audio track source stopping
01-01 18:25:17.143 2378 26623 I MPEG4Writer: Received total/0-length (149/0) buffers and encoded 148 frames. - Audio
01-01 18:25:17.143 2378 26623 I MPEG4Writer: Audio track drift time: 0 us
01-01 18:25:17.145 2378 26593 I MediaCodecSource: encoder (audio) stopping
01-01 18:25:17.164 2378 26593 I MediaCodecSource: encoder (audio) stopped
01-01 18:25:17.179 2370 2706 D audio_hw_primary: fast_out-do_set_route: Enabled Audio Route(media-speaker)
01-01 18:25:17.179 2370 2706 D audio_hw_primary: fast_out-set_audio_route: ENABLE --Input Device for active usage
01-01 18:25:17.182 2370 26608 D audio_hw_primary: primary_in-in_standby: enter
01-01 18:25:17.182 2370 26608 I audio_hw_primary: primary_in-do_stop_input_stream: Stopped PCM Device
01-01 18:25:17.182 2370 26608 I audio_hw_primary: primary_in-in_standby: Transit to Idle
01-01 18:25:17.233 2370 2706 I audio_hw_primary: fast_out-do_open_output_stream: Opened PCM Device is /dev/snd/pcmC0D4p
01-01 18:25:17.233 2370 2706 I audio_hw_primary: fast_out-out_write: Transit to Idle
01-01 18:25:17.234 2370 2706 I audio_hw_primary: fast_out-out_write: Transit to Playing
01-01 18:25:17.263 2370 26608 I audio_hw_primary: primary_in-do_close_input_stream: Closed PCM Device
01-01 18:25:17.263 2370 26608 D audio_hw_primary: primary_in-set_audio_route: [CAPTURE] current-device(mic) new-device(mic) in cur-mode(normal) & new-mode(normal)!
01-01 18:25:17.263 2370 26608 D audio_hw_primary: primary_in-set_audio_route: Capture Device is Disabled (mic)
01-01 18:25:17.270 2370 26608 D audio_hw_primary: primary_in-do_set_route: Disabled Audio Route(media-mic)
01-01 18:25:17.270 2370 26608 I audio_hw_primary: primary_in-in_standby: Transit to Standby
01-01 18:25:17.270 2370 26608 D audio_hw_primary: primary_in-in_standby: exit
01-01 18:25:17.270 2370 26608 D audio_hw_primary: primary_in-in_set_parameters: enter with param = routing=0
01-01 18:25:17.270 2370 26608 D audio_hw_primary: primary_in-in_set_parameters: exit
01-01 18:25:17.271 2378 2952 D MPEG4Writer: Audio track source stopped
01-01 18:25:17.271 2378 2952 D MPEG4Writer: Audio track stopped
01-01 18:25:17.271 2378 2952 D MPEG4Writer: Duration from tracks range is [0, 9472000] us
01-01 18:25:17.271 2378 2952 D MPEG4Writer: Stopping writer thread
01-01 18:25:17.271 2378 26613 D MPEG4Writer: 0 chunks are written in the last batch
01-01 18:25:17.271 2378 2952 D MPEG4Writer: Writer thread stopped
01-01 18:25:17.271 2378 2952 D MPEG4Writer: Video track stopping
01-01 18:25:17.271 2378 2952 D MPEG4Writer: Audio track stopping
01-01 18:25:17.273 22154 22154 E MediaRecorder: stop failed: -1007
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: stop fail
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: java.lang.RuntimeException: stop failed.
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at android.media.MediaRecorder.stop(Native Method)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at com.android.camera.VideoModule.stopVideoRecording(VideoModule.java:1968)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at com.android.camera.VideoModule.onStopVideoRecording(VideoModule.java:782)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at com.android.camera.VideoModule.onShutterButtonClick(VideoModule.java:830)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at com.android.camera.ShutterButton.performClick(ShutterButton.java:195)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at android.view.View$PerformClick.run(View.java:22387)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at android.os.Handler.handleCallback(Handler.java:751)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at android.os.Handler.dispatchMessage(Handler.java:95)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at android.os.Looper.loop(Looper.java:154)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at android.app.ActivityThread.main(ActivityThread.java:6088)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at java.lang.reflect.Method.invoke(Native Method)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
01-01 18:25:17.273 22154 22154 E CAM_VideoModule: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
01-01 18:25:17.273 22154 22154 V CAM_VideoModule: Deleting video /storage/emulated/0/DCIM/Camera/VID_20150101_182506.mp4.tmp
01-01 18:25:17.274 22154 22154 D CAM_OrientMgrImpl: unlock orientation
01-01 18:25:17.275 22154 22154 D CAM_VideoModule: Check the SlowrecordValidate == >false recordMode =>normal-recording
01-01 18:25:17.276 22154 22154 I CAM_VideoModule: Releasing media recorder.
01-01 18:25:17.277 2370 26609 D audio_hw_primary: device-adev_close_input_stream: enter with Audio Usage(primary_in)
01-01 18:25:17.277 2370 26609 D audio_hw_primary: primary_in-in_standby: enter
01-01 18:25:17.277 2370 26609 D audio_hw_primary: primary_in-in_standby: exit
01-01 18:25:17.277 2370 26609 D audio_hw_primary: device-adev_close_input_stream: Closed primary_in stream
01-01 18:25:17.279 22154 22154 V CAM_FocusOverlayMgr: stored focus setting for camera: continuous-picture
01-01 18:25:17.280 22154 22154 V CAM_FocusOverlayMgr: focus mode resolved from setting: CONTINUOUS_PICTURE
01-01 18:25:17.280 2365 2754 I ExynosCamera: [CAM_ID(0)][]-INFO(getParameters[924])

请教下大神,知道是哪里问题不或者提供下解决的思路?在下感激不尽,谢谢!
...全文
21330 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
星空语 2021-03-26
  • 打赏
  • 举报
回复
01-01 18:25:17.273 22154 22154 V CAM_VideoModule: Deleting video /storage/emulated/0/DCIM/Camera/VID_20150101_182506.mp4.tmp log里只看到删除文件,没有save文件,就算保存失败也应该有save fail,应该是没进行save
澪焰 2020-12-30
  • 打赏
  • 举报
回复
这个问题后来有解决么?
jklinux 2017-10-10
  • 打赏
  • 举报
回复
会不会是文件保存的路径没权限 ?
~未来可期~ 2017-10-10
  • 打赏
  • 举报
回复
首先感谢您的回答,文件保存的路径是有权限的,我感觉是硬编码有问题或者是某些参数设置不对之类的?找了好几天都没有找到问题的所在。

1,318

社区成员

发帖
与我相关
我的任务
社区描述
主要是开发驱动技术
社区管理员
  • 驱动程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧