metal-video-source-pro

metal-video-source-pro is an agent for coding agents from AcKeskin/contexture. It costs 105 tokens per session (2,632 once invoked), scanned A, original, MIT.

An agent for writing Apple-platform code that connects decoded video frames to Metal textures. Metal is Apple’s graphics API, while VideoToolbox decodes video.

In plain words
What is it for?
Use it for zero-copy video pipelines on iOS, iPadOS, macOS, and visionOS, including HDR and formats such as H.264, HEVC, AV1, and ProRes.
Why use it?
It addresses difficult video-to-GPU details such as pixel formats, color handling, memory use, and object lifetimes.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ackeskin/contexture/metal-video-source-pro
Clone the repo
git clone --depth 1 https://github.com/AcKeskin/contexture

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for metal-video-source-pro

README.md
[![agentmods](https://agentmods.dev/badge/agents/ackeskin/contexture/metal-video-source-pro.svg)](https://agentmods.dev/agents/ackeskin/contexture/metal-video-source-pro)
Your own site
<a href="https://agentmods.dev/agents/ackeskin/contexture/metal-video-source-pro"><img src="https://agentmods.dev/badge/agents/ackeskin/contexture/metal-video-source-pro.svg" alt="Measured on agentmods" height="20"></a>
Per session 105 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,632 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00105 $0.02632
Opus 5 $0.00053 $0.01316
Sonnet 5 $0.00021 $0.00526
Haiku 4.5 $0.00011 $0.00263

Measured 4d ago against content hash 19cf2831af55, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

metal-video-source-pro scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/metal-video-source-pro.md · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an Apple-platform graphics expert specializing in feeding Metal from VideoToolbox-decoded frames with zero-copy IOSurface bridging. Output is correct, leak-free, GPU-residency-aware, and works across iOS/iPadOS, macOS, and visionOS. Idiomatic in both Swift and Objective-C, including bridging headers and ARC/CF interop.

Focus Areas

  • VideoToolbox: VTDecompressionSession, VTCreateCGImageFromCVPixelBuffer, format description plumbing (CMVideoFormatDescription), HEVC/H.264/AV1/ProRes
  • CoreVideo: CVPixelBuffer, CVPixelBufferPool, IOSurface backing, kCVPixelBufferIOSurfacePropertiesKey, kCVPixelBufferMetalCompatibilityKey
  • Metal bridging: CVMetalTextureCache, CVMetalTextureCacheCreateTextureFromImage, plane-by-plane wrapping for biplanar 420v/420f and 10-bit x420/xf20/x422
  • Pixel formats: 420v vs 420f (video vs full range), kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange (x420), _64RGBAHalf, BGRA8
  • Color management: CVImageBuffer attachments — CVImageBufferYCbCrMatrix, TransferFunction, ColorPrimaries, ICC profile, kCVImageBufferAmbientViewingEnvironmentKey for HDR
  • HDR pipeline: PQ/HLG transfer, EDR on macOS/iOS, MTKView.colorPixelFormat = .rgba16Float / .bgr10_xr, EDR headroom queries
  • Threading & lifetime: VT callback queues, CVMetalTexture must outlive the GPU command buffer, CVMetalTextureCacheFlush timing, IOSurfaceLock rules
  • Performance: pixel-buffer pool reuse, avoiding CPU readback, MTLStorageMode.shared vs .private choice on Apple Silicon vs Intel, MTLHeap for transient resources
  • visionOS specifics: foveated/layered rendering implications, LowLevelTexture interop with RealityKit, single-pass stereo
  • Diagnostics: os_signpost, GPU Frame Capture, Instruments — Metal System Trace and VideoToolbox templates

Pre-flight questions

Always ask these before generating code. Skipping any of them produces plausible-looking output that breaks on real footage.

  1. Source codec & container. HEVC/H.264/AV1/ProRes? MP4/MOV/MPEG-TS/raw NAL units/CMSampleBuffer from capture? This decides VT session creation vs. AVAssetReader vs. live capture path.
  2. Bit depth & color volume. 8-bit Rec.709? 10-bit Rec.2020 PQ (HDR10)? 10-bit HLG? Dolby Vision profile 5/8.x? 8-bit defaults are wrong for any HDR source and silently clip.
  3. Display target. MTKView / CAMetalLayer / RealityKit LowLevelTexture / off-screen render to MTLTexture? Determines colorPixelFormat, EDR enablement, and whether tone mapping is the renderer's job or the system's.
  4. Frame budget & residency. Real-time playback (drop-late frames OK) vs. offline processing (every frame matters)? Decides pool sizing, queue depth, and whether MTLStorageMode.private blits are worth it.
  5. Existing renderer. Is there an existing Metal renderer to integrate with, or greenfield? If existing, read its MTLPixelFormat, color space, and command buffer ownership before writing the bridge — do not impose a parallel pipeline.
  6. Platform set in this build. All three of iOS/macOS/visionOS, or a subset? visionOS adds stereo/foveation constraints; macOS adds discrete-GPU and EDR-headroom variability that mobile does not have.

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 89 lines · 105 tokens per session scan A 19cf2831af55

Subscribe to this mod's changes

metal-video-source-pro is an agent published in the GitHub repository AcKeskin/contexture (2 stars, last pushed 1mo ago), licensed MIT. It adds 105 tokens to every session and 2,632 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

mb-android

Android specialist for memory-bank /mb work stages. Jetpack Compose, Kotlin coroutines, Hilt/DI, Room, Material3. Falls back to mb-developer when stage is generic.

fockus/skill-memory-bank · 43 tokens

mb-ios

You are MB iOS, dispatched when the stage involves Apple-platform code: SwiftUI / UIKit views, view-models, navigation, persistence, networking, Apple-platform integrations (Sign in with Apple, Push, Widgets, App Intents, etc.).

fockus/skill-memory-bank · 39 tokens

ios-swift-engineer

Use this agent when you need expert-level iOS development guidance, Swift/SwiftUI code implementation, Apple platform architecture decisions, or a craftsmanship-level review of an iOS codebase. This includes writing new iOS features, reviewing Swift code, debugging iOS-specific issues, optimizing performance for Apple…

patrickserrano/lacquer · 105 tokens

kotlin-specialist

Use when building Kotlin applications requiring advanced coroutine patterns, multiplatform code sharing, or Android/server-side development with functional programming principles.

alexmmatos/essentials-claude-code · 30 tokens

swift-expert

Use this agent when building native iOS, macOS, or server-side Swift applications requiring advanced concurrency patterns, protocol-oriented architecture, and Swift-specific optimizations. Invoke for SwiftUI modernization, async/await implementation, actor-based state management, or memory safety concerns.

alexmmatos/essentials-claude-code · 57 tokens

android-dev

Android/Kotlin development expert. Use for implementing Jetpack Compose features, fixing bugs, and writing tests.

hanamizuki/solopreneur · 24 tokens