UxPlay
AirPlay Unix mirroring server
Install / Use
/learn @antimof/UxPlayREADME
UxPlay 1.72: AirPlay-Mirror and AirPlay-Audio server for Linux, macOS, and Unix (also runs on Windows).
Now developed at the GitHub site https://github.com/FDH2/UxPlay (where ALL user issues should be posted, and latest versions can be found).
-
NEW on github: Support for service discovery using a Bluetooth LE "beacon" for both Linux/*BSD and Windows (as an alternative to Bonjour/Rendezvous DNS-SD service discovery). The user must set up a Bluetooth LE "beacon", (a USB 4.0 or later "dongle" can be used). See instructions below. The beacon runs independently of UxPlay and regularly broadcasts a Bluetooth LE ("Low Energy") 46 byte packet informing nearby iOS/macOS devices of the local IPv4 network address of the UxPlay server, and which TCP port to contact UxPlay on. Two versions of a Python script (Python >=3.6) "uxplay-beacon.py", (one for Linux/*BSD using BlueZ LEAdvertisingManager1 with DBus, and one for Windows using winrt/BluetoothLEAdvertisementPublisher) are ready for users to run: the appropriate version will be installed when UxPlay is built. They independently run Service-Discovery beacons that iOS devices respond to. Instructions are given below.
-
NEW on github: option
-vrtp <rest-of-pipeline>bypasses rendering by UxPlay, and instead transmits rtp packets of decrypted h264 or h265 video to an external renderer (e.g. OBS Studio) at an address specified inrest-of-pipeline. (Note: this is video only, an option "-rtp" which muxes audio and video into a mpeg4 container still needs to be created: Pull Requests welcomed). -
NEW on github: (for Linux/*BSD Desktop Environments using D-Bus). New option
-scrsv <n>provides screensaver inhibition (e.g., to prevent screensaver function while watching mirrored videos without keyboard or mouse activity): n = 0 (off) n=1 (on during video activity) n=2 (always on while UxPlay is running). Tested on Gnome/KDE/Cinnamon/Mate/Xfce 4: may need adjustment for other Desktop Environments (please report). (watch output ofdbus-monitorto verify that inhibition is working). Might not work on Wayland. -
NEW on github: option -ca (with no filename given) will now render Apple Music cover art (in audio-only mode) inside UxPlay. (-ca
<filename>will continue to export cover art for display by an external viewer). -
NEW in v1.72: Improved Support for (YouTube) HLS (HTTP Live Streaming) video with the new "-hls" option (introduced in 1.71).* Only streaming from the YouTube iOS app (in "m3u8" protocol) is currently supported: (streaming using the AirPlay icon in a browser window is not yet supported).Click on the airplay icon in the YouTube app to stream video. Please report any issues with this new feature of UxPlay.
The default video player for HLS is GStreamer playbin v3: use "-hls 2" to revert to playbin v2 if some videos fail to play.
- user-requested features: added support for setting a password (as an alternative to on-screen pin codes) to control client access (-pw option, see "man pw" or this README for details); added support for setting initial client audio-streaming volume (-vol option), and output of audio-mode metadata to file (for display by some external process, -md option).
ISSUES (Please help to solve if you have expertise)
- in HLS video streaming from the YouTube app (-hls option), rendered using GStreamer's media player "playbin3" (or playbin2, with option -hls 2), we don't understand how to correctly deal with "interstitials" (= 15 sec commercials) when "skip" is pressed on the client. (HLS is handled by handlers in lib/http_handlers.h). (Should response to HTTP requests POST /action (playlistRemove) and POST /Stop be modified? Wireshark data from HLS on an AppleTV model 3 with UN-upgraded original OS (unencrypted communications) could be useful!
Highlights:
- GPLv3, open source.
- Originally supported only AirPlay Mirror protocol, now has added support for AirPlay Audio-only (Apple Lossless ALAC) streaming from current iOS/iPadOS clients. Now with support for Airplay HLS video-streaming (currently only YouTube video).
- macOS computers (2011 or later, both Intel and "Apple Silicon" M1/M2 systems) can act either as AirPlay clients, or as the server running UxPlay. Using AirPlay, UxPlay can emulate a second display for macOS clients.
- Support for older iOS clients (such as 32-bit iPad 2nd gen., iPod Touch 5th gen. and iPhone 4S, when upgraded to iOS 9.3.5, or later 64-bit devices), plus a Windows AirPlay-client emulator, AirMyPC.
- Uses GStreamer plugins for audio and video rendering (with options to select different hardware-appropriate output "videosinks" and "audiosinks", and a fully-user-configurable video streaming pipeline).
- Support for server behind a firewall.
- Raspberry Pi support both with and without hardware video decoding by the Broadcom GPU. Tested on Raspberry Pi Zero 2 W, 3 Model B+, 4 Model B, and 5.
- Support for running on Microsoft Windows (builds with the MinGW-64 compiler in the unix-like MSYS2 environment).
Note: AirPlay2 multi-room audio streaming is not supported: use shairport-sync for that.
Packaging status (Linux and *BSD distributions)
-
Install uxplay on Debian-based Linux systems with "
sudo apt install uxplay"; on FreeBSD with "sudo pkg install uxplay"; on OpenBSD with "doas pkg_add uxplay". Also available on Arch-based systems through AUR. Since v. 1.66, uxplay is now also packaged in RPM format by Fedora 38 ("sudo dnf install uxplay"). -
For other RPM-based distributions which have not yet packaged UxPlay, a RPM "specfile" uxplay.spec is now provided with recent releases (see their "Assets"), and can also be found in the UxPlay source top directory. See the section on using this specfile for building an installable RPM package.
-
If your distribution does not supply UxPlay, or you want the latest version, it is very easy to build it yourself: see the very detailed instructions for building UxPlay from source. later in this document.
After installation:
-
(On Linux and *BSD): if a firewall is active on the server hosting UxPlay, make sure the default network port (UDP 5353) for mDNS/DNS-SD queries is open (see Troubleshooting below for more details); also open three UDP and three TCP ports for Uxplay, and use the "uxplay -p
<n>{=html}" option (see "man uxplay" or "uxplay -h"). -
Even if you install your distribution's pre-compiled uxplay binary package, you may need to read the instructions below for running UxPlay to see which of your distribution's GStreamer plugin packages you should also install.
-
For Audio-only mode (Apple Music, etc.) best quality is obtained with the option "uxplay -async", but there is then a 2 second latency imposed by iOS. Use option "uxplay -ca" to display any "Cover Art" that accompanies the audio.
-
If you are using UxPlay just to mirror the client's screen (without showing videos that need audio synchronized with video), it is best to use the option "uxplay -vsync no".
-
Add any UxPlay options you want to use as defaults to a startup file
~/.uxplayrc(see "man uxplay" or "uxplay -h" for format and other possible locations; the location can also be set with "uxplay -rc location"). In particular, if your system uses PipeWire audio or Wayland video systems, you may wish to add "as pipewiresink" or "vs waylandsink" as defaults to the file. (Output from terminal commands "ps waux | grep pulse" or "pactl info" will contain "pipewire" if your Linux/BSD system uses it). -
For Linux/*BSD systems using D-Bus, the option
-scrsv 1inhibits the screensaver while there is video activity on UxPlay (-scrsv 2inhibits it whenever UxPlay is running). -
For Linux systems using systemd, there is a systemd service file uxplay.service found in the UxPlay top directory of the distribution, and also installed in
<DOCDIR>/uxplay/systemd/(where DOCDIR is usually/usr/local/share/doc), that allows users to start their own instance of UxPlay as a rootless daemon: it should either be added to the directory /etc/systemd/user, or the user can just create their own systemd directory~/.config/systemd/user/and then copy uxplay.service into it. To save uxplay terminal output to a file ~/uxplay.log, uncomment the StandardOutput entry in uxplay.service. Thensystemctl --user [start/stop/enable/disable/status] uxplaycan be used to control the daemon. If it is enabled, the daemon will start at the user's first login and stop when they no longer have any open sessions. See https://www.baeldung.com/linux/systemd-create-user-services for more about systemd user services. If more than one user might simultaneously run uxplay this way, they should specify distinct -p and -m options (ports and deviceID) in their startup files. Note: it is NOT recommended to run UxPlay as a root service.
-
On Raspberry Pi: models using hardware h264 video decoding by the Broadcom GPU (models 4B and earlier) may require the uxplay option -bt709. If you use Ubuntu 22.10 or earlier, GStreamer must be [patched](https://github.com/FD
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
