Logo von Iphone Duo Camera

Iphone Duo Camera

Community
mirzaaghazadeh
iphone-duo-camera

Build camera capture for iPhone Duo's two front cameras — the virtual front camera, the inner under-display and outer ultra-wide devices, AVCaptureDeviceDirectionCoordinator, preview mirroring and video gravity, and dual-display capture. Use when an app captures photo or video and must handle the device opening, closing or flipping.

Übersicht

Herausgebermirzaaghazadeh
Repositoryiphone-duo-skills
Skill-Nameiphone-duo-camera
Sterne
188
Forks
9
Mitgelieferte Dateien
Nur Anweisungen
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von mirzaaghazadeh auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Iphone Duo Camera in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-camera
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mirzaaghazadeh/iphone-duo-skills.git /tmp/iphone-duo-skills
mkdir -p .claude/skills
cp -r /tmp/iphone-duo-skills/skills/iphone-duo-camera .claude/skills/iphone-duo-camera
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Iphone Duo Camera in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Iphone Duo Camera automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Iphone Duo Camera nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Camera on iPhone Duo

iPhone Duo is the first iPhone with two front cameras. Both are square sensors with an ultra-wide field of view: one on the outer display, and one beneath the inner display — the first under-display camera on iPhone.

That creates a problem no previous iPhone had. "Front" no longer means "pointing at the user."

Pick a strategy first

Everything downstream follows from this choice.

The virtual front camera — automatic, limited

Discover a front camera the ordinary way — an AVCaptureDevice.DiscoverySession requesting position .front with a Wide or Ultra Wide device type — and on iPhone Duo you resolve to a new virtual front camera. It switches between the two physical cameras by itself: inner camera when open, outer camera when closed.

It always uses the most relevant camera, and you write no switching code.

The cost is that it exposes only what both physical cameras can do:

  • max 1080p, 60 fps
  • no depth

If the app needs 4K, high frame rates, or any depth-based feature, this is not enough.

The individual cameras — full capability, your responsibility

Address each physically, via the built-in outer ultra-wide and built-in inner ultra-wide device types:

Inner (under-display)Outer
Max video1080p @ 60 fps4K @ 120 fps
Depthsupportedsupported

Full capabilities, but now you must switch cameras when the user opens or closes the device. Which brings us to the hard part.

Which way is a camera actually facing?

AVCaptureDevice has always had a fixed position — on iPhone, .back or .front. Both of iPhone Duo's front cameras report .front. That property describes where a camera sits on the hardware, and on a device whose displays can face opposite directions it no longer tells you where the camera points relative to the person looking at your UI.

Three situations make this concrete:

  • The user is looking at the inner display while the app streams the outer front camera — a "front" camera facing away from them.
  • The device closes while that camera is streaming, and the same camera swings around to face them directly.
  • The device is open and flipped, so a rear camera is now the selfie camera.

AVCaptureDeviceDirectionCoordinator

AVCaptureDeviceDirectionCoordinator (in AVKit) answers the real question: which cameras are forward-facing right now, relative to a given view. Build one from three things — your app's UIView, the device types to monitor, and a change handler — and it keeps you current as the device moves.

Because it is anchored to a view, it reports facing relative to the display that view is on. When the view is on the outer display, the outer front cameras are forward-facing and the rear cameras are backward-facing. Open the device, the view moves to the inner display, your handler fires, and now the inner front camera is forward-facing while the outer front and rear cameras are backward-facing.

Driving both displays at once? Create one coordinator per view. Each reports relative to its own display, so the same rear camera is forward-facing to the outer view's coordinator and backward-facing to the inner view's. That is correct, not contradictory — it is the whole point. (Dual-display camera UI comes from the scene accessories API; see ../iphone-duo-hinge-and-scenes/SKILL.md.)

Concurrency

The coordinator is tied to a view, so it is isolated to the main actor. Your change handler must not call AVFoundation APIs directly.

It never hands you an AVCaptureDevice. The handler receives an AVCaptureDeviceDirectionMap, which sorts the tracked cameras into two arrays:

swift
var forwardFacingDeviceDescriptors: [AVCaptureDeviceDescriptor]
var backwardFacingDeviceDescriptors: [AVCaptureDeviceDescriptor]

The same map is also readable at any time from the coordinator's deviceDirections property, so you aren't limited to reacting inside the handler.

An AVCaptureDeviceDescriptor is a sendable stand-in for a capture device, carrying uniqueID, localizedName, deviceType, mediaTypes and position. Pass a descriptor to your camera actor and construct the AVCaptureDevice there. That is the intended path; don't try to smuggle a device across the boundary.

Note that both of these types live in AVKit, alongside the coordinator — not in AVFoundation, where you might reasonably go looking first.

Because you get arrays rather than a single device, your handler has to choose: typically the first forward-facing descriptor whose deviceType matches what you're streaming. Don't assume exactly one camera faces forward.

What the handler should do

  1. Reconfigure the AVCaptureSession to keep streaming from whichever camera is now forward-facing.
  2. Re-evaluate mirroring. Mirroring should follow the direction, not the position: when a rear camera has become the forward-facing one, mirror the preview so it feels like a normal selfie view.
  3. Apply any UI updates the camera change implies.

Preview polish

Streaming the rear camera's full field of view on the inner display leaves extra room around the preview. Two reasonable choices: offset the preview and group controls in the space left over, or let the preview fill the display. Control this with videoGravity on AVCaptureVideoPreviewLayer.

Streaming an ultra-wide front camera, exploit the square sensor — set dynamicAspectRatio on the AVCaptureDevice to pick a landscape aspect ratio that fills the inner display.

Rotation. Adopt AVCaptureDeviceRotationCoordinator so previews and captures stay upright. On iPhone Duo it updates when the app moves between displays, which is what keeps rotation consistent across both. Once you have adopted it, turn off camera-sensor-orientation compensation — it is enabled on all of iPhone Duo's front cameras and is redundant work once the rotation coordinator is doing the job.

Note that direction and rotation are separate coordinators solving separate problems. Which camera to stream is direction; which way its output is oriented is rotation. Most camera apps on this device want both.

Checklist

  1. Build against the iOS 27.1 SDK.
  2. Decide: virtual front camera (automatic, 1080p60, no depth) or individual cameras (full capability, manual switching).
  3. If individual, adopt AVCaptureDeviceDirectionCoordinator — one per view.
  4. In the change handler, read the AVCaptureDeviceDirectionMap, pick a forward-facing descriptor, reconfigure the session, re-decide mirroring, and update UI. Move devices across actors as AVCaptureDeviceDescriptor.
  5. Set videoGravity, and dynamicAspectRatio for front-camera capture.
  6. Adopt AVCaptureDeviceRotationCoordinator, then disable sensor-orientation compensation.
  7. Consider a CameraCaptureAccessory so the subject sees something on the outer display.
  8. Test opening, closing and flipping the device mid-session in Device Hub.

Apple's related articles: Choosing a Camera by the Direction it Faces and Supporting Device Rotation in Your Camera App. For the square sensor generally, see Support the Center Stage front camera in your iOS app from WWDC26.

Häufig gestellte Fragen

Was macht der KI-Skill Iphone Duo Camera?

Build camera capture for iPhone Duo's two front cameras — the virtual front camera, the inner under-display and outer ultra-wide devices, AVCaptureDeviceDirectionCoordinator, preview mirroring and video gravity, and dual-display capture. Use when an app captures photo or video and must handle the device opening, closing or flipping.

Warum Iphone Duo Camera in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Iphone Duo Camera besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Iphone Duo Camera in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/mirzaaghazadeh/iphone-duo-skills/tree/main/skills/iphone-duo-camera ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Iphone Duo Camera nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Iphone Duo Camera verwenden?

So viele Sie möchten. In TypingMind können Sie Iphone Duo Camera mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Iphone Duo Camera kostenlos?

Der Skill wird von mirzaaghazadeh auf GitHub veröffentlicht. Prüfen Sie im Repository, ob dort Lizenzbedingungen angegeben sind. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇