capacitor-community / capacitor-community/camera-preview
Support real-time access to video stream during recording (streaming bytes or chunks)
- Dominant language
- Java
- Stars
- 227
- Forks
- 185
- PR merge metrics
- No merged PRs in 30d
Description
I'm currently using the plugin to capture video, but the `startRecordVideo` / `stopRecordVideo` methods only return the final file path after recording ends.
For my use case, I need to process the video data in real time (e.g., stream it somewhere). Not having access to the video stream during recording limits this.
I'd like to have a way to access the video bytes or stream while recording is ongoing.
This could be through an event that emits chunks of video data (e.g. like MediaRecorder.ondataavailable in web), or some API that allows piping the data out in real-time.
Using navigator.mediaDevices + MediaRecorder, but it has limited support and performance issues in iOS WebView.
I've seen related questions like: [#366](https://github.com/capacitor-community/camera-preview/issues/366) [#279](https://github.com/capacitor-community/camera-preview/issues/279)
A real-time stream or callback mechanism would unlock many use cases: live processing, encryption, cloud upload, etc.
Even exposing intermediate temporary files during recording would help.
Contributor guide
Assessment
This issue has not been assessed yet.