# CoreMF composition and audio demonstrations

Produced and verified 2026-10-29. All imagery and the stereo 440 Hz tone are
generated; there is no speech, customer footage, model or stock-media dependency.
These are offline functional examples, not performance or release qualification.

The generated grid below is historical. The Technology page now uses a
[real sports grid](sports-grid.md); its retired generated MP4 and poster are
no longer included on the website.

## Data flow and outputs

1. Two-source production: file input → decode → CoreGL picture-in-picture →
   native H.264 encode → MP4. Input-one audio → CoreAudio gain (−6 dB) → AAC →
   the same MP4. CoreMF supplies graph execution, processing and output; an
   operator UI, production rules and deployment remain application work.
2. Four-source grid: four file inputs → decode → CoreGL 2×2 grid → native
   H.264 encode → MP4, with input-one audio encoded as AAC. This is an offline
   compositor example, not an RTC/dynamic-MCU demonstration or proof of
   frame-accurate synchronization between independent inputs.

| Recorded file        | Video                                    | Audio                       | Validation                                                              |
| -------------------- | ---------------------------------------- | --------------------------- | ----------------------------------------------------------------------- |
| production-input.mp4 | 15 s, 640×360, 25 fps, 375 H.264 frames  | Stereo AAC, 48 kHz          | Generated input                                                         |
| production-pip.mp4   | 15 s, 640×360, 25 fps, 375 H.264 frames  | Stereo AAC, mean −30.1 dBFS | Full error-checked decode; input mean −24.1 dBFS, measured gain −6.0 dB |
| production-grid.mp4  | 15 s, 1280×720, 25 fps, 375 H.264 frames | Input-one stereo AAC        | Full error-checked decode                                               |

Audio streams are 14.997333 seconds, with 703 decoded AAC frames; video lasts
15 seconds. PNG posters are actual decoded frames at two seconds, not mockups.

## Generate inputs

Use an available FFmpeg development executable. This development demonstration
uses libx264; it does not distribute that executable or its libraries.

```sh
ffmpeg -f lavfi -i 'testsrc2=size=640x360:rate=25:duration=15' \
  -f lavfi -i 'sine=frequency=440:sample_rate=48000:duration=15' \
  -c:v libx264 -pix_fmt yuv420p -preset veryfast -crf 24 \
  -c:a aac -ac 2 -shortest production-input.mp4
ffmpeg -f lavfi -i 'smptebars=size=640x360:rate=25:duration=15' \
  -c:v libx264 -pix_fmt yuv420p -preset veryfast -crf 24 bars.mp4
ffmpeg -f lavfi -i 'testsrc2=size=640x360:rate=25:duration=15' \
  -vf hue=h=90 -c:v libx264 -pix_fmt yuv420p -preset veryfast -crf 24 hue.mp4
ffmpeg -f lavfi -i 'testsrc2=size=640x360:rate=25:duration=15' \
  -vf negate -c:v libx264 -pix_fmt yuv420p -preset veryfast -crf 24 inverted.mp4
```

## Run actual CoreMF graphs

These commands use the development runAPI application and its available native
encoders; the website does not provide a development runtime download. Adapt
file paths and selected encoders to your agreed package. Shell quoting shown
below is POSIX; pass the same JSON as one argument on Windows.

```sh
runAPI -i production-input.mp4 -i bars.mp4 -f glcomposite -n 2 \
  -filter-config '{"width":640,"height":360,"layers":[{"input":0,"x":0,"y":0,"w":640,"h":360,"fit":"cover"},{"input":1,"x":390,"y":204,"w":224,"h":126,"fit":"contain","alpha":0.9}]}' \
  -af gain -audio-filter-config '{"gain_db":-6}' -o production-pip.mp4 -p tc

runAPI -i production-input.mp4 -i bars.mp4 -i hue.mp4 -i inverted.mp4 \
  -f glcomposite -n 4 \
  -filter-config '{"width":1280,"height":720,"layers":[{"input":0,"x":0,"y":0,"w":640,"h":360,"fit":"cover"},{"input":1,"x":640,"y":0,"w":640,"h":360,"fit":"cover"},{"input":2,"x":0,"y":360,"w":640,"h":360,"fit":"cover"},{"input":3,"x":640,"y":360,"w":640,"h":360,"fit":"cover"}]}' \
  -o production-grid.mp4 -p tc
```

## Test conditions

Existing Windows x86-64 MSVC Debug development runtime, Intel UHD Graphics 770,
ANGLE D3D11/OpenGL ES 3.0, renderer software=0. Logs identify native libx264 and
AAC encoders. A GPU composition stage does not establish GPU encoding or an
end-to-end GPU-resident pipeline. No BYO encoder was used in these examples.

- CoreMF.dll SHA-256: ca43814a2397d1434d2bf2879994a7c294eef0e76cd79a66eace6ce12e433531
- runAPI.exe SHA-256: b46d4c0a3d76f4e896e35c2a6051b0f8b99648e470fcea00cc85d5b8cfa1f881
- production-input.mp4 SHA-256: 70ab14c19bc5ebd9440e40522a826e3841669a67ae69d67692598e5750d4f08f
- production-pip.mp4 SHA-256: 0c9436e94c3d3bc0cabd7f9a60d2b7464deae6eaa3623f3cb84f30e1651dd466
- production-grid.mp4 SHA-256: 86f74df68cb1d6eca64f92c5cc19f822ba13293ab3a4a72889da35db53ba2014

Validation used `ffprobe -count_frames` and complete `ffmpeg -v error -xerror
-i OUTPUT -f null -` decoding on both outputs. Audio means used decoded
`volumedetect` on input and PiP output. Posters used `-ss 2 -frames:v 1`.

No commercial Windows qualification, RTC capacity, synchronization guarantee,
latency, memory or performance-parity result is claimed. The commercial SDK
uses its separately audited LGPL-compatible runtime and qualification process.
Only generated media and reproduction instructions are included here.
