Amigo AIAmigo AI
Back to Home

Face Swap SDK for Live Streaming Apps

Amigo AI SDK lets you add real-time face swap to any iOS live streaming app. It runs entirely on-device using CoreML at 30fps with 512px output — no server round-trips, no cloud costs, no added latency. The per-frame API accepts a CVPixelBuffer and returns a face-swapped CIImage, so it drops into any RTMP, HLS, or custom streaming pipeline. Pricing is $0.01 per session with 1,000 free every month.

How do I add face swap to my streaming app?

The SDK's processFrame() API is designed for real-time pipelines. You capture a camera frame, pass it through the SDK, and send the result to your streaming encoder. The entire pipeline runs on-device.

StreamPipeline.swift
import AmigoFaceSwapSDK

// Initialize once at stream start
try await AmigoFaceSwap.initialize(apiKey: "your-key")
let latent = try await AmigoFaceSwap.enrollFace(from: facePhoto)

// In your camera frame callback:
func captureOutput(_ output: AVCaptureOutput,
    didOutput sampleBuffer: CMSampleBuffer, ...) {
  guard let pixelBuffer = sampleBuffer.imageBuffer else { return }
  if let swapped = try? AmigoFaceSwap.processFrame(
    pixelBuffer, using: latent
  ) {
    rtmpEncoder.encode(swapped) // Send to RTMP/HLS
  }
}

Why on-device face swap for streaming?

Cloud-based face swap APIs add 100-500ms of network latency per frame — unacceptable for live streaming. You'd also be sending every camera frame to a server, creating privacy and bandwidth costs.

Amigo AI SDK processes each frame in under 33ms on the device GPU. No frames leave the device. Your RTMP/HLS encoder gets the swapped frame with zero network overhead. The viewer sees face-swapped content with the same latency as a normal stream.

The SDK works with any streaming pipeline — custom AVFoundation capture, ReplayKit screen recording, or third-party streaming SDKs. Wherever you have access to a CVPixelBuffer, you can insert face swap.

What performance can I expect?

DeviceFPSLatency/Frame
iPhone 15 Pro45fps~22ms
iPhone 1435fps~28ms
iPhone 1230fps~33ms
iPhone SE (3rd gen)25fps~40ms

Frequently asked questions

Ready to add face swap to your app?

1,000 free sessions every month. No credit card required. $0.01/session after that. Integrate in minutes, not days.