Sending VideoRecordEvent Finalize [error: ERROR_NO_VALID_DATA] use camerax Recorder along with mlkit android java.

44 views
Skip to first unread message

Sreenath K

unread,
Mar 21, 2024, 3:06:10 AMMar 21
to Android CameraX Discussion Group
Sending VideoRecordEvent Finalize [error: ERROR_NO_VALID_DATA] use camerax Recorder along   with mlkit android java.  

Xi Zhang (张熹)

unread,
Mar 21, 2024, 2:05:26 PMMar 21
to Sreenath K, Android CameraX Discussion Group
Hi Sreenath, thanks for reaching out. Could you provide more information? e.g. what is your set up code and maybe the logcat.

On Thu, Mar 21, 2024 at 12:06 AM Sreenath K <sreena...@gmail.com> wrote:
Sending VideoRecordEvent Finalize [error: ERROR_NO_VALID_DATA] use camerax Recorder along   with mlkit android java.  

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/ab6172e5-c8fa-48da-96dd-d3b9409a244dn%40android.com.

Sreenath K

unread,
Mar 22, 2024, 2:41:58 AMMar 22
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]

Xi Zhang (张熹)

unread,
Mar 22, 2024, 1:18:43 PMMar 22
to Sreenath K, Android CameraX Discussion Group
Your code looks correct. What is your CameraX version / device model? If you can create a minimal reproducible sample on GitHub, I can debug it for you.
Reply all
Reply to author
Forward
0 new messages