coremedia-timing-samplebuffer-workflow

A guide to handling timing and sample data in Apple Core Media, the framework used to represent media times, clocks, formats, and audio or video samples.

In plain words
What is it for?
Use it when working with CMTime, CMSampleBuffer, timebases, format descriptions, AVSampleBufferDisplayLayer, or AVSampleBufferRenderSynchronizer.
Why use it?
It helps diagnose drifting playback, dropped or invalid buffers, incorrect timestamps, missing format information, and synchronization failures.

Skill for Claude CodeCodex

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 skills/gaelic-ghost/socket/coremedia-timing-samplebuffer-workflow
Any agent
npx skills add gaelic-ghost/socket --skill coremedia-timing-samplebuffer-workflow
Clone the repo
git clone --depth 1 https://github.com/gaelic-ghost/socket

Made for: Claude Code, Codex.

Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,442 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.00090 $0.01442
Opus 5 $0.00045 $0.00721
Sonnet 5 $0.00018 $0.00288
Haiku 4.5 $0.00009 $0.00144

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

Security

Grade A, and why

coremedia-timing-samplebuffer-workflow 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 2d 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.

plugins/apple-dev-skills/skills/coremedia-timing-samplebuffer-workflow/SKILL.md · 118 lines

How it starts

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

Core Media Timing Sample Buffer Workflow

Purpose

Guide Core Media timing and sample-buffer repair. This skill owns the precise media-time and sample payload boundary: CMTime, time ranges, clocks, timebases, format descriptions, sample buffers, attachments, readiness, presentation and decode timestamps, synchronization, and diagnostic probes.

It is not the AVFoundation pipeline owner, not the AVAudioEngine graph owner, and not a generic media-player workflow.

When To Use

  • Use this skill when code manipulates CMTime, CMTimeRange, CMClock, CMTimebase, CMFormatDescription, CMSampleBuffer, attachments, sample readiness, timestamps, dropped buffers, AVSampleBufferDisplayLayer, or AVSampleBufferRenderSynchronizer.
  • Use this skill when existing media code drifts, drops frames or buffers, appends invalid samples, loses format descriptions, confuses decode and presentation time, mishandles host time, or cannot explain synchronization failures.
  • Recommend avfoundation-media-pipeline-workflow when the primary problem is capture, playback, reader, writer, export, or asset loading.
  • Recommend avaudio-engine-workflow when the primary problem is engine graph rendering rather than sample-buffer timing.

Single-Path Workflow

  1. Classify the timing request:
    • time math
    • sample-buffer creation or inspection
    • format description
    • attachments or dropped buffers
    • display layer or render synchronizer
    • writer or reader timestamp repair
    • audio/video synchronization
  2. Apply the Apple docs gate:
    • read current Core Media or AVFoundation sample-buffer documentation first
    • state the documented timing or sample-buffer behavior relied on
    • apply ../../shared/references/apple-media-type-ownership.md before converting Core Media values to raw numbers, dictionaries, or app-specific sample wrappers
  3. Inspect timing invariants:
    • validity, timescale, epoch, and numeric value
    • presentation timestamp, decode timestamp, and duration
    • time range start and end
    • format description presence and media type
    • readiness and dropped-buffer flags
    • host clock or audio clock relationship
  4. Repair common failure modes:
    • invalid CMTime treated as zero
    • mismatched timescales or lossy conversion hidden in helpers
    • missing or wrong CMFormatDescription
    • CMSampleBuffer, CMFormatDescription, attachments, readiness, or dropped-buffer metadata hidden behind opaque dictionaries before diagnostics
    • presentation and decode timestamps swapped or flattened
    • sample-buffer append without readiness or writer back-pressure
    • video synchronized to host time when audio-clock sync is required
  5. Return one recommendation with:
    • timing class
    • documented Apple behavior relied on
    • invariant checks
    • repair findings
    • diagnostic probes
    • validation and handoff expectation

Read the full file on GitHub · 118 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 118 lines · 90 tokens per session scan A 7182db0f4b45

Subscribe to this mod's changes

coremedia-timing-samplebuffer-workflow is a skill published in the GitHub repository gaelic-ghost/socket (6 stars, last pushed 6d ago), licensed Apache-2.0. It adds 90 tokens to every session and 1,442 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 skills, from other repositories

baocut

BaoCut-only operator for the installed bcut CLI and .bcut projects. Implicitly trigger only when the request explicitly names BaoCut or bcut, targets a .bcut project or BaoCut Subtitle Studio, or continues a BaoCut workflow already established in the conversation. Do not trigger solely for generic audio or video…

JimLiu/baocut · 160 tokens

grok-imagine

Generate or edit images via Grok Imagine Image 2.0 through DroidProxy (no XAIAPIKEY). Use when the user asks to generate, create, draw, imagine, or edit an image, illustration, icon, mockup, or similar visual asset and DroidProxy Grok OAuth is available. Prefer this over inventing image URLs or base64.

nikships/droidproxy · 81 tokens

scenekit-product-stages

Build and debug SceneKit scenes where one 3D object (a product, badge, coin, wheel) performs on a transparent stage inside a SwiftUI app - studio lighting, real shadows, baked keyframe choreography, hand-rolled physics, gestures and haptics, multi-scene sequencing. Use when working with SCNView or SceneView in…

dembsky/PropMotion · 306 tokens

music

Apple Music in your terminal. Play tracks, route to AirPlay speakers and AirPods, search 100 million songs, build playlists, play radio stations, discover new music, favorite tracks, seek within a song, browse your listening history, browse your library by artist, album, or track. This is the plugin's only entry…

anthonymaley/MusicTUI · 408 tokens

xcode-disk-cleanup

Audit and safely clean Xcode-related developer storage on macOS. Use whenever a developer mentions low disk space, Xcode storage, DerivedData, simulator devices or runtimes, stale beta platforms in Xcode Settings, DeviceSupport, archives, dSYMs, CocoaPods caches, simulator dyld caches, project .build folders…

AvdLee/Xcode-Disk-Cleanup-Agent-Skill · 147 tokens

qiaomu-icon-generator

Generate multiple app, favicon, or website icon candidates with either the local QM Icon Studio CLI or Codex built-in image generation with reference icons, then present a contact sheet so the user can choose. Use when building websites or apps and needing reusable icon options.

joeseesun/qiaomu-icon-generator · 58 tokens