CameraXVideo/README.md
This sample demonstrates CameraX Video Capture (Recorder) API with Capture + Preview use case combination. VideoCapture is in early release cycle, try it out and share your thoughts and experience; especially for the functionalities you need but unavailable, please let us know hear them.
CameraX VideoCapture is available from version 1.1.0-alpha10+, can capture to local file with the formats of:
This sample demonstrates MediaStore capture case, the other 2 types are very similar (just replacing the MediaStoreOutputOptions with FileOutputOptions or FileDescriptorOutputOptions in CameraFragment.kt).
Conceptually 3 steps to use video recorder in this Alpha version: create a recorder(use it to create recordings), bind it to pipeline, record with recording (created from recorder). A little more detailed steps:
The steps are not strict, but some do have dependencies (like Recorder created then bind); recordings could be created before or after binding, but activeRecording needs to be after binding. VideoCapture does not support multiple concurrent streams(capturing),so only one ActiveRecording could exists.
Related code is in CameraFragment.kt (in its own fragment), and most of the code deals with UI, the essential VideoCapture code is quite simple and straightforward (in startVideoCapture() function )
To learn more about the VideoCapture, refer to
This sample uses the Gradle build system. To build this project, use the "gradlew build" command or use "Import Project" in Android Studio.
If you've found an error in this sample, please file an issue: https://github.com/android/camera-samples
Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.