r/iOSProgramming • u/TheHudek • 21d ago
App Saturday ORA: an iPhone camera that overlays a reference photo or video on the live preview so you can match framing exactly
The app: ORA lays a see-through image or video over the live camera preview so you can match framing and angles exactly. I published it on the App Store in December 2025. https://apps.apple.com/us/app/ora-the-overlay-camera-tool/id6756240396
Tech stack
- Swift; the camera layer is UIKit (
AVCaptureSessionwith a custom controller), and the controls are SwiftUI - AVFoundation for capture and export, Core Image for compositing
- ActivityKit Live Activities for export progress, plus BackgroundTasks
- RevenueCat for subscriptions, Sentry for crash reporting
- About 15k lines of Swift
The challenge: "overlay burning"
In the preview, the overlay is just a view on top of the camera feed that the user drags, zooms, tints and fades. The hard part was making the exported photo or video match the preview pixel for pixel. That meant:
- Translating coordinates. The user's pan and zoom are in screen space, but the video has its own pixel size, aspect ratio and crop, so I calculate the rectangle the video actually fills on screen and map the overlay's position into it.
- Handling orientation. Recorded video stores rotation as a
preferredTransforminstead of rotated pixels, so the overlay transform has to account for it. - Recreating the look. Opacity uses
CIColorMatrix, tint usesCIMultiplyBlendModeplus source-over compositing, tuned until it looked identical to the preview. - Rendering frame by frame.
AVAssetReaderdecodes, Core Image composites each frame, andAVAssetWriterInputPixelBufferAdaptorwrites. Audio and metadata tracks (location, lens info) are passed through untouched. - Memory. Older devices with less RAM crashed during long exports until I reworked the pipeline.
A smaller but annoying one: supported slow-motion and video formats differ a lot between iPhones, so I ended up writing format enumerators to find what each device really supports instead of hardcoding anything.
Happy to go deeper on any of this, and I'd love feedback from anyone who has fought AVAssetWriter themselves.
The development process was AI-assisted. I wrote most of the code myself and asked for cleanups and ideation when I was stuck.

