Status Update
Comments
gi...@gmail.com <gi...@gmail.com> #2
wu...@google.com <wu...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
wu...@google.com <wu...@google.com>
le...@google.com <le...@google.com>
le...@google.com <le...@google.com> #4
The issue happens on several Haiwei devices. Not found a good way to workaround by adjusting camera2 parameters.
It can be workaround by using OpenGL buffer copying surface + CameraDevice.TEMPLATE_PREVIEW
.
Will apply this workaround after effect pipeline for VideoCapture is complete.
le...@google.com <le...@google.com> #5
Some information:
The issue can be reproduced by some other Huawei devices such as Mate 20 Pro
, Honor 10
and Nova 3
.
The issue can't be reproduced by Nova 3e
and P8 Lite
.
The issue isn't limited to 16:9 Preview resolution, but also on some specific resolutions.
For example,
On Honor 10, Preview with below resolutions have low frame rate issue.
Resolution | Aspect Ratio |
---|---|
1280x960 | 4:3 |
960x720 | 4:3 |
640x480 | 4:3 |
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit b598b07748c00f8309173bf0a62bf1aaa3dd3007
Author: leo huang <leohuang@google.com>
Date: Mon Sep 12 17:56:47 2022
Fix low framerate when using VideoCapture and Preview usecases with 16:9 aspect ratio
Relnote: "Fixed low framerate when using VideoCapture and Preview usecases with 16:9 aspect ratio on some Huawei devices."
Bug: 223643510
Test: manully testing
Change-Id: If8c8824d923cefd368d24bf27cedc58b0ecccebb
M camera/camera-video/src/main/java/androidx/camera/video/VideoCapture.java
M camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/DeviceQuirksLoader.java
A camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/PreviewDelayWhenVideoCaptureIsBoundQuirk.java
M camera/camera-core/src/main/java/androidx/camera/core/processing/DefaultSurfaceEffect.java
le...@google.com <le...@google.com> #7
Hi,
I can only add the devices into our workaround list
Huawei P30 Android 10 - build number 11.0.0.174
HUAWEI P30 Pro Android 10 - EMUI 11.0.0.
Huawei Nova 5T
So does those device in my local which can also reproduce the bug.
Mate 20 Pro
Honor 10
Nova 3
If you encounter the same issue on other devices, please let me know. Then I can add them to the list as well. Thank you.
[Deleted User] <[Deleted User]> #8
Hello,
I also could reproduce the bug on a Huawei P40 Pro
wu...@google.com <wu...@google.com> #9
Hi there, this fix will go with the CameraX release in Oct. Please stay tuned. Thanks!
le...@google.com <le...@google.com> #10
Thanks for the info for Huawei P40 Pro
, will add it.
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit 32f656671b2331caef49b0a4104185fe0772dd45
Author: leo huang <leohuang@google.com>
Date: Thu Sep 22 16:35:01 2022
Add Huawei P40 Pro to preview dealy quirk
Bug: 223643510
Test: ./gradlew camera:camera-video:lintDebug
Change-Id: Iab029183c00fd48ce59ccb1b58811d9eaf02df54
M camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/PreviewDelayWhenVideoCaptureIsBoundQuirk.java
na...@google.com <na...@google.com> #12
The following release(s) address this bug:
androidx.camera:camera-core:1.2.0-rc01
androidx.camera:camera-video:1.2.0-rc01
fe...@gmail.com <fe...@gmail.com> #13
In the code by the original submitter use:
// Case: Analyzer
val imageAnalysis = ImageAnalysis.Builder()
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
.build()
imageAnalysis.setAnalyzer(cameraExecutor, CustomAnalyzer { _ -> })
// CaseGroup
val useCaseGroup = UseCaseGroup.Builder()
.addUseCase(preview)
.addUseCase(imageAnalysis)
.build()
and
private class CustomAnalyzer(private val listener: CustomAnalyzerListener) : ImageAnalysis.Analyzer {
override fun analyze(image: ImageProxy) {
image.close()
}
}
xw...@gmail.com <xw...@gmail.com> #14
xw...@gmail.com <xw...@gmail.com> #15
ap...@google.com <ap...@google.com> #16
Branch: androidx-main
commit b316a5118b2b8258d670417a3b4dfa4e78eec8ca
Author: leo huang <leohuang@google.com>
Date: Wed Sep 06 10:44:57 2023
Add all Huawei devices to preview delay quirk
Bug: 223643510
Test: ./gradlew camera:camera-video:lintDebug
Change-Id: I540081f87bf6804e6ec14c385743e548c4255d44
M camera/camera-video/src/main/java/androidx/camera/video/internal/compat/quirk/PreviewDelayWhenVideoCaptureIsBoundQuirk.java
le...@google.com <le...@google.com> #17
Hi,
We added all Huawei devices to the list.
But the change will be applied from CameraX 1.4.0-alpha01
since 1.3
is going to be stable version.
na...@google.com <na...@google.com> #18
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.camera:camera-video:1.4.0-alpha01
Description
* Huawei P30 Android 10 - build number 11.0.0.174
* HUAWEI P30 Pro Android 10 - EMUI 11.0.0.
* Huawei Nova 5T
Not reproducible on:
Huawei P20 Pro Android 10 - build number 10.0.0.197
Sony Xperia Z5 Compact (4.6 inches) Android 10
Galaxy Note8 Android 9.0.0
Galaxy S8 Android 9.0.0
CAMERAX VERSION: 1.1.0-beta02 (and all alphas)
DESCRIPTION:
It previews and records with a very low framerate when using:
VideoCapture and Preview UseCases + target aspect ratio of 16:9 + CameraSelector.LENS_FACING_BACK
P.S. It works fine when instead of aspect ratio, target resolution is set (added that as a comment in example code)
CODE TO REPRODUCE:
--- LAYOUT:
<FrameLayout xmlns:android="
<androidx.camera.view.PreviewView
android:id="@+id/preview_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</FrameLayout>
--- ACTIVITY:
private lateinit var cameraProviderFuture : ListenableFuture<ProcessCameraProvider>
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// ......
val cameraProviderFuture = ProcessCameraProvider.getInstance(this)
cameraProviderFuture.addListener(Runnable {
val cameraProvider = cameraProviderFuture.get()
bindPreview(cameraProvider)
}, ContextCompat.getMainExecutor(this))
}
private fun bindPreview(cameraProvider : ProcessCameraProvider) {
val cameraSelector: CameraSelector = CameraSelector.Builder()
.requireLensFacing(CameraSelector.LENS_FACING_BACK)
.build()
// Case: Preview
val preview: Preview = Preview.Builder()
.setTargetAspectRatio(RATIO_16_9)
// Works fine when using actual size (with:1080 height:2097):
//.setTargetResolution(Size(binding.previewView.measuredWidth, binding.previewView.measuredHeight))
.build()
// Case: Video
val recorder = Recorder.Builder().build()
val videoCapture = VideoCapture.withOutput(recorder)
// CaseGroup
val useCaseGroup = UseCaseGroup.Builder()
.addUseCase(preview)
.addUseCase(videoCapture)
.build()
preview.setSurfaceProvider(binding.previewView.surfaceProvider)
cameraProvider.bindToLifecycle(this, cameraSelector, useCaseGroup)
}