Repository navigation
v0.1.0-beta.3 — iOS decodes to YUV by default, frame-accurate preview
Pre-release
Pre-release
Requires react-native-skia@3.7.1 and react-native-webgpu@0.17.0.
Install
npm install --save-exact react-native-skia@3.7.1 react-native-webgpu@0.17.0 react-native-reanimated@4.5.3 react-native-worklets@0.11.3
npm install --save-exact react-native-skia-webgpu-video@0.1.0-beta.3
npx --no-install skia-video-patch-canvasAdd the last command to your app's postinstall, then rebuild the native app; see the README. The archive attached here is the same package, installable by URL.
Changes since v0.1.0-beta.2
Update LICENSE (#21)
See #21.
Invite users to share projects in Show and tell (#23)
- README: new Built with it section (before Development) that links to the thread; featured projects get listed there.
.github/DISCUSSION_TEMPLATE/show-and-tell.yml: form for new Show and tell posts (link, description, platforms, screenshot).
iOS decodes to YUV by default, and a frame-accurate preview (#24)
- iOS now decodes composition frames to YUV (NV12) by default, as Android always has. A 4K frame takes 12.4 MB instead of 33.2 MB of BGRA, so the decoder keeps five 4K frames ahead instead of one or two. On an iPhone 15 Pro, 4K 60 fps previews show 77–90% of their frames on time instead of 46–48%, and the three compositions that stopped on the video memory budget now play (61/61 benchmark cases). Camera footage (Rec.709 or HLG) renders the same. To keep the previous behavior, set
framePixelFormat: 'rgba'on the composition. - New
framePixelFormatoption onVideoComposition:'auto'(the default, YUV on both platforms),'yuv'or'rgba', applied to the preview and the export. - Trade-offs of YUV on iOS: an export spends 2–4 ms more per frame (4K exports unchanged, a 120-clip montage takes 18.1 s instead of 14.0 s), and files tagged Display P3 or sRGB are no longer converted to Rec.709. Use
'rgba'where either matters. - Smoother, frame-accurate preview.
drawFramenow gets the time its frames were picked at. Read a few milliseconds later, the time ran up to a frame ahead of the video at 60 fps, so overlays drawn from it were a frame off. The preview now draws the frame due at 99–100% of vsyncs at 30, 24 and 60 fps (Pixel 8a before: 51–93%). splitImportAndDrawno longer drops one frame in two when a new frame arrives at every vsync (75 skipped frames in 6 s down to 2).- Android 15+: a playing preview asks the display for its highest refresh rate. The Pixel 8a no longer falls to 30 Hz during playback, where a 60 fps clip lost one frame in two, and reaches 120 Hz when Smooth display is on.
- 120 Hz on ProMotion iPhones: add
CADisableMinimumFrameDurationOnPhone(Boolean,YES) to your app'sInfo.plist. Without it, iOS holds the preview at 60 Hz. - iOS: the composition decoder runs at user-interactive priority. At utility, a warm iPhone froze 60 fps clips for 300–500 ms.
getVideoResourceStats().nativereports the iOS preview's frame ring refusals, empty decode queues and slow decode ticks.
Release 0.1.0-beta.3 (#25)
Version bump for 0.1.0-beta.3. npm run ship merges it once CI passes, then tags and publishes it.
Not yet qualified
- Memory over long sessions (last checked on 3.0.6).
- HDR beyond the HLG to SDR conversion, audible output and A/V synchronization.
- Known Pixel 8a issues, all predating beta.3: a seek while playing a 4K sequence leaves the clock stalled, and a paused seek into a 120-clip lazy montage does not show its frame.
- An iOS export with
yuvframes (the default) spends 2–4 ms more per frame than withframePixelFormat: 'rgba'.
Full changelog: v0.1.0-beta.2...v0.1.0-beta.3
SHA-256 of the archive: b08654749d1b182a10d37eefbfd000921ed6aff3546daedbc06171eb72e8ec8b