Status Update
Comments
le...@google.com <le...@google.com> #2
Hi,
If this issue only occurs on this device, it could be an issue unique to this device.
Since we don't have the device, would it be possible to retrieve the log?
wu...@google.com <wu...@google.com>
ni...@gmail.com <ni...@gmail.com> #3
I only see this error in the log:
Video capture ends with error: androidx.camera.video.internal.encoder.EncodeException: Error 0x16
The CameraX on the device work and shows a picture, but when you try to record a video, the recording process stops. Perhaps the error is related to the encoding of the video?
le...@google.com <le...@google.com> #4
Yes, the error is related to encoding as it originates from the device's codec. However, the exact meaning of the error code can vary depending on the specific device.
A full log may provide additional details, but not guaranteed to pinpoint the exact cause. Would you be able to share the full log?
ni...@gmail.com <ni...@gmail.com> #5
I have provided all the information I have. What is the full log you are asking about?
le...@google.com <le...@google.com> #6
To capture a full log, one can run the following adb command adb logcat > log.txt
while reproducing the bug. This will save the log to a file named log.txt
.
One example is like the attachment in
However, this method may not be feasible for users reporting bugs directly or through the Play Store console. The adb logcat
command requires a specific setup with the Android Debug Bridge (adb) tool, which most users might not have. Additionally, Play Store console reports don't typically include full logs captured through adb.
While I understand it might be difficult to get the full log, I was just wondering if there might be a chance.
ni...@gmail.com <ni...@gmail.com> #7
Unfortunately, I will not be able to provide the full log. The error occurs for the user and I do not have access to his device. I only have the CameraX error code.
here I found a list of supported devices
is there any chance that the error can be fixed?
le...@google.com <le...@google.com> #8
Sorry for the delayed response.
The devices listed in
One chance is that we will be able to investigate further if someone receives the device and shares it within our internal shard resources.
le...@google.com <le...@google.com> #9
Some update:
I were not able to reproduce the issue on two Honor devices that I recently got.
Models:
Description
CAMERAX VERSION
I use the following dependencies:
implementation "androidx.camera:camera-lifecycle:1.3.3"
implementation "androidx.camera:camera-view:1.3.3"
implementation "androidx.camera:camera-camera2:1.3.3"
implementation 'androidx.camera:camera-video:1.3.3'
implementation "androidx.camera:camera-view:1.3.3"
implementation "androidx.camera:camera-extensions:1.3.3"
ANDROID OS BUILD NUMBER: Android 13
DEVICE NAME: Honor WDY-LX1
DESCRIPTION:
In my application, I used the video capture code from the documentation
// Implements VideoCapture use case, including start and stop capturing.
private fun captureVideo() {
val videoCapture = this.videoCapture ?: return
viewBinding.videoCaptureButton.isEnabled = false
val curRecording = recording
if (curRecording != null) {
// Stop the current recording session.
curRecording.stop()
recording = null
return
}
// create and start a new recording session
val name = SimpleDateFormat(FILENAME_FORMAT, Locale.US)
.format(System.currentTimeMillis())
val contentValues = ContentValues().apply {
put(MediaStore.MediaColumns.DISPLAY_NAME, name)
put(MediaStore.MediaColumns.MIME_TYPE, "video/mp4")
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
put(MediaStore.Video.Media.RELATIVE_PATH, "Movies/CameraX-Video")
}
}
val mediaStoreOutputOptions = MediaStoreOutputOptions
.Builder(contentResolver, MediaStore.Video.Media.EXTERNAL_CONTENT_URI)
.setContentValues(contentValues)
.build()
recording = videoCapture.output
.prepareRecording(this, mediaStoreOutputOptions)
.apply {
if (PermissionChecker.checkSelfPermission(this@MainActivity,
Manifest.permission.RECORD_AUDIO) ==
PermissionChecker.PERMISSION_GRANTED)
{
withAudioEnabled()
}
}
.start(ContextCompat.getMainExecutor(this)) { recordEvent ->
when(recordEvent) {
is VideoRecordEvent.Start -> {
viewBinding.videoCaptureButton.apply {
text = getString(R.string.stop_capture)
isEnabled = true
}
}
is VideoRecordEvent.Finalize -> {
if (!recordEvent.hasError()) {
val msg = "Video capture succeeded: " +
"${recordEvent.outputResults.outputUri}"
Toast.makeText(baseContext, msg, Toast.LENGTH_SHORT)
.show()
Log.d(TAG, msg)
} else {
recording?.close()
recording = null
Log.e(TAG, "Video capture ends with error: " +
"${recordEvent.error}")
}
viewBinding.videoCaptureButton.apply {
text = getString(R.string.start_capture)
isEnabled = true
}
}
}
}
}
OBSERVED RESULTS:
I get an error on the user's device:
Video capture ends with error: androidx.camera.video.internal.encoder.EncodeException: Error 0x16