When Android uses mediaRecorder for recording, onPreviewFrame does not call back

when I use Android camera recording while taking camera frame data for algorithm processing, I use mediaRecorder for recording and algorithm processing in onPreviewFrame.
the video recording is normal when using mediaRecorder alone. The callback is normal when using onPreviewFrame alone.
but when both are used at the same time, the callback of onPreviewFrame will not be executed.
then I set the callback using setPreviewCallback in both surfaceChanged and surfaceCreated, and there is a problem that the callback can be executed but not recorded.

I wonder if any of the students have encountered the same problem? Is there any way to solve it?

Mar.23,2021

api1 does not support calling onPreviewFrame while recording. The preview function during recording is done by mMediaRecorder.setPreviewDisplay (mPreview.getHolder (). GetSurface ());
), that is, the preview during recording is done by MediaRecorder.
to achieve video recording with callback at the same time, you can only use the implementation of camera api2.
api2 to be easy. Try Baidu yourself.


have brothers solved it?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea2e37-1c0c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea2e37-1c0c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?