AI Video Editing in Mobile Apps: Feature Implementation
A client sends a 15-minute interview recording with thirty pauses and "ums". Manually cutting them out would cost an hour. Our AI pipeline does it in 30 seconds. We implemented auto-cutting, background replacement, color correction, and smart reframe for iOS and Android. This article covers the technical details.
What Problems AI Editing Solves
AI video editing is not magic but a set of specific algorithms: automatic removal of pauses and filler words, background replacement, color correction by reference, and smart cropping to vertical format. Each requires its own stack and architecture. Let's review the key ones.
How Auto-Cut of Pauses Works
The user records a spoken video. We transcribe the audio via Whisper API or Deepgram, getting a JSON with timestamps for each word. Then we find pauses longer than 0.5 sec and words from a stop-list ("um", "ah", "like"). We generate an FFmpeg cut-list and assemble the final video.
# Backend: генерация FFmpeg фильтра из транскрипции Whisper def build_cut_filter(transcript_words, pause_threshold=0.5, filler_words=None): filler_words = filler_words or {"эм", "ну", "вот", "как бы", "типа"} segments_to_keep = [] prev_end = 0.0 for i, word in enumerate(transcript_words): gap = word["start"] - prev_end if gap > pause_threshold: pass if word["word"].lower().strip(".,!?") in filler_words: continue segments_to_keep.append((word["start"], word["end"])) prev_end = word["end"] filter_parts = "+".join( f"between(t,{s},{e})" for s, e in merge_segments(segments_to_keep, gap=0.05) ) return f"select='{filter_parts}',setpts=N/FRAME_RATE/TB" Whisper with word_timestamps=True gives accuracy of ±20 ms — enough for smooth cuts. On the mobile device, the video is uploaded to the server, a task runs, and the result is downloaded. Playback uses AVPlayer or ExoPlayer.
Why Background Replacement on Mobile Is Challenging
For a static camera we use MediaPipe Selfie Segmentation — it runs in real time (30 fps) on modern devices. For a moving camera with multiple people — server-side processing via SAM 2 (Segment Anything Model 2).
MediaPipe on Android:
val options = ImageSegmenterOptions.builder() .setBaseOptions(BaseOptions.builder().useGpu().build()) .setOutputCategoryMask(false) .setOutputConfidenceMasks(true) .build() val segmenter = ImageSegmenter.createFromOptions(context, options) The result is a confidence mask from 0 to 1. Apply it to each frame via Metal (iOS) or Vulkan (Android). For 1080p 30fps, GPU is mandatory — CPU cannot handle it. Server-side processing via SAM 2 gives better quality but takes 2–5 minutes per minute of video even on an A100.
Smart Crop for Format (Auto Reframe)
Converting 16:9 to 9:16 with intelligent cropping is an object tracking task. On mobile:
- Face detection on every keyframe (every 0.5 sec) —
VNDetectFaceRectanglesRequeston iOS - Build a trajectory of subject movement
- Smooth panning with an ease function
- FFmpeg
cropfilter with dynamic parameters
# FFmpeg: кроп с движением (x меняется от 0 до 540 за 10 сек) ffmpeg -i input.mp4 \ -vf "crop=608:1080:'min(max(cx-304,0),672)':0" \ -c:v libx264 output_9x16.mp4 cx is the x-coordinate of the subject from tracking data. On the server, a Python script generates the FFmpeg command, executes it, and returns the result.
AI Color Correction
Using a reference photo, we apply a CinematicLUT via Core Image on iOS (about 100 ms per frame). For a text description ("make it look like golden hour"), we call a server that generates a LUT via Stable Diffusion + ControlNet. The resulting .cube file is applied to the video via FFmpeg: -vf lut3d=lut_file.cube.
Mobile Editor: Architecture
The timeline editor is a nontrivial UI challenge. Minimal stack:
- iOS:
AVMutableCompositionfor tracks,AVVideoCompositionfor effects,AVAssetExportSessionfor export - Android:
MediaCodec+MediaMuxerfor low-level processing orMedia3 Transformer(recommended)
Media3 Transformer allows applying cropping, speed changes, and color in one pass with GPU acceleration via OpenGL ES. This is simpler than working directly with MediaCodec.
Timeline architecture details
The timeline is built on layers: video track, audio track, effects layer. Each clip is an object with a time scale. Effects (crop, speed, background replacement) are applied via AVVideoComposition or Media3 Transformer. We use the Command pattern for change history.
Comparison of Approaches: On-device vs Server
| Criterion | On-device (MediaPipe, Core Image) | Server (Whisper, SAM 2, FFmpeg) |
|---|---|---|
| Latency | Real time (30 fps) | 2–5 minutes per minute of video |
| Quality | Good for typical scenes | Excellent, even complex scenes |
| Dependency | Device GPU | Internet, server GPU |
| Cost | Free (on-device compute) | API fees or GPU rental |
Choice depends on the task: for mass features (auto-cut) the server works; for real-time editing — on-device.
What's Included in the Work to Build an AI Editor
We deliver a turnkey result:
- Research and selection of the optimal stack for your task
- Implementation of backend (Python/FastAPI, Whisper, FFmpeg) and mobile SDK (iOS/Android)
- Integration with the existing app (code, dependencies, documentation)
- Setup of StoreKit 2 / Billing 6 for subscriptions if needed
- Testing on 10+ real devices
- Publishing to App Store and Google Play (assistance with Review Guidelines)
- 3 months of stable operation guarantee after launch
Our experience: 5+ years in mobile development, 20+ projects with video and AI, certified Apple and Google specialists. We guarantee quality and adherence to deadlines.
Timelines and Cost
- Single feature (auto-cut or background replacement) — 1–2 weeks
- Full editor with multiple features, timeline, and export — 6–10 weeks
- Cost is calculated individually after requirements analysis. Contact us — we will evaluate your project in 2 days.
Order development of an AI video editor for your mobile app. Get a consultation on technical details and timelines.







