[英]How to remove lag in camera preview in Flutter when using startImageStream?
我正在创建一个 Flutter 应用程序,其中我使用 Flutter 的camera: 0.5.8+2
插件。
In the application, I have a CameraPreview
widget in the build
function and use the startImageStream((CameraImage img){})
to set up an image stream after initializing the controller, to use the stream of images for further processing.
我面临的问题是,当我使用startImageStream
function 时, CameraPreview
滞后很多,尽管我接收图像的 fps 很高(这是应用程序的要求),但我想消除滞后。
我已经尝试过其他解决方法,例如controller.takePicture(path)
这有助于消除滞后,但它会在模拟器上将图像的 fps 降至 6 左右(应用程序的要求是 > 10 fps),这在模拟器上甚至更低真手机。
任何人都可以为这个问题推荐一种解决方法/替代方法,其中消除了CameraPreview
中的滞后以及流式传输图像的 fps 很高(> 10 fps)?
尝试更改ResolutionPreset
。 就我而言,我设置了ResolutionPreset.medium
然后它工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.