Skip to content

About

Screen mirroring from Mac to any DLNA smart TV — the native macOS way to get Miracast-style casting. Free, no AirPlay, no Chromecast, no cables. Works with Philips, Samsung, Sony, LG & Panasonic TVs from 2012 onwards.

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

MirrorCast for macOS

Screen mirroring from Mac to any smart TV — the native macOS way to get Miracast-style casting, free and without extra hardware.

No AirPlay. No Chromecast. No HDMI cable. No subscription.

Download Platform License

Powered by Greenstein.Design · built by Rene Grebenstein


What it does

macOS has no Miracast support and older smart TVs have no AirPlay. MirrorCast bridges that gap: it is a tiny native menu-bar app that mirrors your Mac screen — with sound — to virtually any TV that speaks DLNA/UPnP, which covers nearly every smart TV sold since about 2012.

It works especially well with the TVs that every other tool leaves behind:

Brand Typical models
Philips xxPFS / xxPFT / xxPUS series (2012–2018, non-Android)
Samsung Smart TV series C/D/E/F/H/J and newer
Sony Bravia (pre-Android and Android)
Panasonic · LG · Toshiba · Sharp · Grundig · Medion any model with DLNA / "Media Player" / "Wireless Display" support

Is this really Miracast? No — and that is the point. Miracast is a Wi-Fi Alliance standard that Apple never implemented in macOS, so a true Miracast sender does not exist on the Mac. MirrorCast achieves the same result natively — your Mac screen and audio on the TV over Wi-Fi — by using the DLNA/UPnP stack those TVs already ship with. It is the practical macOS answer to "how do I Miracast from a MacBook".

Latency is a few seconds. Perfect for films, series, YouTube, photos, slide decks and music. Not made for gaming or precise mouse work.


Install

  1. Download the latest MirrorCast-1.0.0.dmg from the Releases page, open it and drag MirrorCast into your Applications folder.
  2. First launch: right-click the app → Open → Open (the build is ad-hoc signed, not notarized, so Gatekeeper asks once).
  3. Install ffmpeg — the encoder MirrorCast drives. It is not bundled for licensing reasons:
    brew install ffmpeg
    No Homebrew yet? Install it first, or grab a static build from ffmpeg.org.
  4. macOS will ask for Screen Recording and Local Network permission on first mirroring — both are required, nothing leaves your network.

Sound (optional but recommended)

macOS cannot capture system audio on its own. The free, open-source loopback driver BlackHole fixes that:

brew install blackhole-2ch

Then set System Settings → Sound → Output → BlackHole 2ch. Your Mac goes quiet, the TV becomes the speaker (volume via the TV remote), and picture and sound stay in sync because both travel inside the same stream. MirrorCast detects BlackHole automatically.


Use

  1. Click the TV icon in the menu bar.
  2. Fernseher / TV → pick your set (MirrorCast finds every DLNA renderer on the network; Erneut suchen rescans).
  3. Spiegelung starten — after a ~20 second buffer fill, your screen appears on the TV.
  4. Spiegelung beenden stops it again.

Your TV and quality choice are remembered for next time.


Tuning for your TV

Different TV generations accept different formats. Switch under Qualität / Format:

Profile Container / Codecs Use it when
MPEG-2 / AC3 (default) MPEG-PS, MPEG-2 720×576, AC3 the safest choice — works on 2012–2018 sets
MPEG-2 / MP2 MPEG-PS, MPEG-2, MP2 audio TV has no AC3 licence (no sound with the default)
M2TS / MPEG-2 192-byte transport stream TV expects video/vnd.dlna.mpeg-tts
H.264 / MKV (HD) Matroska, H.264 720p, AC3 newer sets — sharper picture
H.264 / M2TS (HD) transport stream, H.264 720p newer sets that refuse MKV

If a profile shows a frozen frame or "file not supported", simply try the next one. Advanced users can edit the PROFILES table in Sources/Profiles.swift — every value is a plain ffmpeg argument.


Why older TVs are so difficult (the interesting part)

These players advertise capabilities they do not actually honour for live sources. Getting a stable picture took a night of packet-level reverse engineering; the findings are baked into the app:

  1. MPEG-PS beats MPEG-TS. The GetProtocolInfo response proudly lists MPEG-TS profiles — yet the file player rejects them. The DVD-style program stream (MPEG-2 + AC3) is what actually decodes.
  2. A live stream must look like a file. Endless chunked responses are refused. MirrorCast serves the live stream with a Content-Length, Accept-Ranges and a plausible duration.
  3. The advertised size must stay below 2³¹ bytes. Several firmwares do signed 32-bit math on the length; a 4 GB "file" wraps around and yields bytes=0-18446744072564584319 in the request — followed by "file not supported".
  4. Bounded range probes need exact answers. The player sniffs a few hundred bytes near the end before it commits; returning anything other than exactly that many bytes aborts playback.
  5. Reconnects must resume byte-exactly. These players reconnect mid-stream and ask for a specific offset. Serving them the newest data instead makes playback race ahead and the audio crackle — MirrorCast keeps a byte-addressed ring buffer so every reconnect continues precisely where it left off.
  6. A cushion beats real time. The TVs buffer almost nothing themselves, so MirrorCast pre-fills ~20 MiB (≈20 s) before it hands over the URL, then keeps that lead. That is where the latency comes from — and why playback stays smooth.
  7. Keep the muxer flushing. macOS only delivers frames when the screen changes; without a small max_interleave_delta, a quiet desktop stalls the audio track too.

Full write-up: docs/HOW-IT-WORKS.md.


Troubleshooting

Symptom Fix
No TV found TV on and on the same Wi-Fi? Some apps (e.g. Spotify) occupy the SSDP port — quit them and rescan. Guest networks and AP isolation block discovery.
Black screen on TV Grant Screen Recording to MirrorCast in System Settings → Privacy & Security, then restart the app.
"File not supported" Try another profile under Qualität / Format.
TV ignores playback (UPnP error 705) Its player is stuck on a dead source — unplug the TV from mains power for 15 s (standby is not enough on Philips quick-start sets).
No sound Install BlackHole, select it as system output, enable Ton mitsenden.
Audio crackles Check BlackHole runs at 48 kHz in Audio MIDI Setup, or pick a lower-bitrate profile.
Picture stutters Wi-Fi bandwidth — move closer to the router or use a wired Mac connection.

Command-line version

A dependency-free Python implementation of the same engine lives in cli/ — handy for scripting, headless Macs or debugging:

python3 cli/mirror.py            # discover TV and start mirroring
python3 cli/mirror.py list       # list DLNA renderers
python3 cli/testmatrix.py        # find the format your TV likes best

Build from source

git clone https://github.com/greensteindesign/mirrorcast-macos.git
cd mirrorcast-macos
./build.sh          # → dist/MirrorCast.app, .dmg and .zip

Requires the Xcode command line tools (xcode-select --install). No external Swift packages, no CocoaPods, no Node — the app is plain Swift against Apple's own frameworks.


Credits, licences and third-party components

MirrorCast bundles no third-party code. It drives tools you install yourself and speaks open standards:

Component Role Licence
FFmpeg screen capture + live encoding (invoked as an external binary, not bundled or linked) LGPL-2.1+ / GPL-2+ depending on build
BlackHole by Existential Audio optional system-audio loopback (installed separately by the user) GPL-3.0
AppKit · Foundation · CoreGraphics native macOS UI, networking and drawing Apple SDK terms
UPnP Device Architecture & UPnP AV (Open Connectivity Foundation) SSDP discovery and AVTransport control open specification
DLNA guidelines contentFeatures.dlna.org profile flags industry standard
Homebrew recommended installer for ffmpeg and BlackHole BSD-2-Clause

Documentation references (consulted as documentation, no code taken): the renderer profiles of Universal Media Server (GPL-2.0) and the Serviio community forums provided invaluable evidence about which containers Philips TVs really accept.

Full attribution: THIRD-PARTY-NOTICES.md.

Trademarks — Miracast is a trademark of the Wi-Fi Alliance; AirPlay and macOS are trademarks of Apple Inc.; Chromecast is a trademark of Google LLC; Philips, Samsung, Sony, LG and Panasonic are trademarks of their respective owners. MirrorCast is an independent project and is not affiliated with, endorsed by, or sponsored by any of them.

Licence

PolyForm Noncommercial License 1.0.0 — free to use, modify and share for any noncommercial purpose (personal use, research, education, charities). Commercial use requires a separate licence: rene@greenstein.design.

Contributing

Pull requests are welcome — especially new format profiles for TV models you own. Run python3 cli/testmatrix.py, note which variant plays, and open a PR or an issue with the result. That way the compatibility table grows for everyone.


Made with care by Greenstein.Design · renegrebenstein.de

If MirrorCast rescued your movie night, a ⭐ on GitHub is very much appreciated.

About

Screen mirroring from Mac to any DLNA smart TV — the native macOS way to get Miracast-style casting. Free, no AirPlay, no Chromecast, no cables. Works with Philips, Samsung, Sony, LG & Panasonic TVs from 2012 onwards.

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages