Sreenath K
unread,Mar 22, 2024, 2:41:58 AM3/22/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Android CameraX Discussion Group, xi...@google.com, Android CameraX Discussion Group, Sreenath K
In my project I using mlKit for video processing, and also I need to record video continuously. But after some random time the recording is stop, and error occurs. When error occurs I can not restart record.
Recorder recorder = new Recorder.Builder()
.setQualitySelector(QualitySelector.from(Quality.HD))
.build();
videoCapture = VideoCapture.withOutput(recorder);
cameraProvider.unbindAll();
cameraProvider.bindToLifecycle(videoAlarmParams.getLifecycle(),
CameraSelector.DEFAULT_BACK_CAMERA,
preview,
imageAnalysis,videoCapture);
recording = videoCapture.getOutput().prepareRecording(context, fileOutputOptions).start(ContextCompat.getMainExecutor(context), videoRecordEvent -> {
if (videoRecordEvent instanceof VideoRecordEvent.Start) {
} else if (videoRecordEvent instanceof VideoRecordEvent.Finalize) {
if (!((VideoRecordEvent.Finalize) videoRecordEvent).hasError()) {
String msg = "Video capture succeeded: " + ((VideoRecordEvent.Finalize) videoRecordEvent).getOutputResults().getOutputUri();
} else {
if (recording!=null){
recording.close();
recording = null;
}
String msg = "Error: " + ((VideoRecordEvent.Finalize) videoRecordEvent).getError();
}
}
});
Error log is
2024-03-20 08:40:04.818 26951-27096 Recorder com.remsup.alpha D Sending VideoRecordEvent Status
2024-03-20 08:40:04.843 26951-26951 Recorder com.remsup.alpha D Transitioning Recorder internal state: RECORDING --> STOPPING
2024-03-20 08:40:04.846 26951-26951 Recorder com.remsup.alpha D Transitioning Recorder internal state: STOPPING --> PENDING_RECORDING
2024-03-20 08:40:04.857 26951-27111 Recorder com.remsup.alpha D Sending VideoRecordEvent Status
2024-03-20 08:40:04.888 26951-27111 Recorder com.remsup.alpha D Sending VideoRecordEvent Status
2024-03-20 08:40:05.844 26951-27096 Recorder com.remsup.alpha D The source didn't become non-streaming before timeout. Waited 1000ms
2024-03-20 08:40:34.847 26951-26951 Recorder com.remsup.alpha D Transitioning Recorder internal state: PENDING_RECORDING --> STOPPING
2024-03-20 08:40:34.848 26951-26951 Recorder com.remsup.alpha D Sending VideoRecordEvent Finalize [error: ERROR_NO_VALID_DATA]
2024-03-20 08:40:34.850 26951-26951 Recorder com.remsup.alpha D Transitioning Recorder internal state: STOPPING --> PENDING_RECORDING
2024-03-20 08:40:34.850 26951-26951 Recorder com.remsup.alpha D Transitioning Recorder internal state: PENDING_RECORDING --> STOPPING
2024-03-20 08:40:34.850 26951-26951 Recorder com.remsup.alpha D Sending VideoRecordEvent Finalize [error: ERROR_NO_VALID_DATA]