[英]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.