Why Nova does not use AVPlayer for local files
Every Mac developer reaches for AVFoundation first. It is well documented, it is maintained by Apple, and it hands you hardware-accelerated playback in about twenty lines of code. We chose not to use it, and that single decision is why Nova opens files that most other Mac players will not.
The problem is not quality, it is scope. AVFoundation understands the containers and codecs that Apple has decided to support. That list is sensible for content distributed through Apple's own channels, and far too short for the files people actually accumulate: an MKV from a Blu-ray remux carrying HEVC video and a DTS-HD track, an AVI from a decade ago, an MTS straight off a camcorder, a WebM with Opus audio. Handed any of those, a player built on AVFoundation shows you a greyed-out window and an unhelpful error.
So local playback in Nova runs on libmpv, the engine behind mpv, which brings the complete FFmpeg demuxer and decoder set with it. That one choice resolves a long list of requirements at once:
- Containers and codecs stop being a feature list and become a non-issue
- Hardware decoding still runs through VideoToolbox, so the efficiency advantage of the Apple silicon media engine is kept
- Subtitles render through libass, which means styled ASS and SSA files look the way their author intended instead of being flattened into plain white text
- Audio filtering — a genuine ten-band equaliser, loudness normalisation, channel balance — comes from a mature filter graph rather than something we would have had to write
- Frame stepping, A-B looping, per-track delay and aspect, crop, zoom and rotation are all engine-level operations that are exact rather than approximated
The cost is that we own more of the stack. libmpv has to be bundled, configured and kept current, and its threading model has to be respected: decoding happens on its own threads and the Flutter layer only composites the resulting texture. Get that boundary wrong and you get a beautiful interface that drops frames.
There is exactly one place where AVFoundation is the right answer, and that is AirPlay. Apple
exposes no public protocol for sending video to an AirPlay receiver yourself, so Nova uses the
system route picker and an AVPlayer with external playback enabled. The interesting
detail is where that player reads from: not the file on disk, but Nova's own local HTTP server. It
is the same delivery path used for Chromecast and DLNA, which keeps one compatibility engine
instead of three.