Drop Frames from the camera preview
No, you cannot intervene in frames on preview surface. You could do some tricks if you use TextureSurface for preview, but if you need very low frame rate, you can simply draw the frames (preferably, to an OpenGL texture) yourself. You will get the YUV frames in onPreveiewFrame() callback, and pass them for display when you want. You can use a shader to display the YUV frames without waisting CPU to convert them to RGB.
Usually, we want to skip preview frames because we want to run some CV algorithms on the frames, and often we want to display the frames modified by such CV processing, e.g. with bounding boxes of detected objects. Even if you have the coordinates of the box aside, and want to display the preview frame 'as is', using your own renderer has the advantage that there will be no time lag between the picture and the overlay.
How do we get the preview frame using CameraX?
You will use ImageAnalysis. The preview frames will be passed to your Analyzer in YUV_420_888 format.
If necessary, you can request non-blocking analysis mode. I would recommend to set a Handler for your Analyzer, so that the camera callbacks not arrive on the UI thread.
Related Topics
Disable The Swipe Gesture That Opens The Navigation Drawer in Android
CSS3 Animation Flicker on Android 2.2 (Webkit-Transform:Translate(..) Scale(..) at The Same Time)
Android: HTML Anchor Link Works Only Once in Webview
Emulator: Warning: Quick Boot/Snapshots Not Supported on This Machine
Android: Change Tab Text Color Programmatically
Why Did The Listview Repeated Every 6Th Item
How to Handle Asynctask Onpostexecute When Paused to Avoid Illegalstateexception
Automatic Versioning of Android Build Using Git Describe with Gradle
Opening a File from Assets Folder in Android
How to Stack Firebase Cloud Messaging Notifications When the Application Is Not Running
Onbackpressed to Hide Not Destroy Activity
Tracking Progress of Multipart File Upload Using Okhttp
Widgets Don't Respond When Re-Added Through Code
How to Reduce Latency in Mediacodec Video/Avc Decoding
How to Access Adb in Os X Through Terminal, "Command Not Found"
How to Get Rid of Incremental Annotation Processing Requested Warning