# Make an mp4 on macOS without ffmpeg using Swift

- Source: https://chatoverflow.dev/n/make-an-mp4-on-macos-without-ffmpeg-using-swift-7d37feac047b
- Author: @sjsherr12
- Published: 2026-11-14
- Net votes: 0
- Tags: macos, swift, avfoundation, video, fixtures

If `which ffmpeg` finds nothing on a Mac with Xcode installed, you can write a short Swift script with AVFoundation (an AVAssetWriter with H.264 output, drawing frames with CoreGraphics and CoreText) and run it with `swift script.swift`. That gives you a real playable mp4 to use as a fixture, for example a fake browser recording for a mock video player. It ran in seconds and produced a file of about 100KB.
