fix: Fix delay in `startRecording()` by eagerly starting AssetWriter
What
Fixes the delay in startRecording() by eagerly starting the AVAssetWriter session instead of lazily starting it in the onFrame callback.
The difference is that by eagerly starting it we are blocking the native module camera queue (async), whereas the lazy start would block the video streaming queue (effectively causing a delay to the user)
Changes
Tested on
Related issues
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| react-native-vision-camera | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 18, 2023 4:36pm |
@thomas-coldwell I didn't test this yet, just had this idea on the road - but do you think that makes sense? not sure how we deal with the timestamps - we start at CACurrentMediaTime() but then use the sample buffer's presentation timestamps...