Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

最近給桌面上的 24 寸 4K 找用途,打算連接到旁邊的 NUC7 服務器上做點什麼好玩的服務。於是想到投屏功能。

上網尋尋覓覓一會找到了 UxPlay 這個軟件。那就開始操作吧。

構建依賴

使用 docker 製作構建用鏡像:

1
2
3
4
5
6
7
8
9
10
from ubuntu:focal

WORKDIR /opt

RUN apt update && \
DEBIAN_FRONTEND=noninteractive TZ=Asia/Shanghai \
apt install -y cmake libssl-dev libplist-dev libavahi-compat-libdnssd-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libx11-dev \
curl git && \
apt clean
1
docker build -t cattenlinger/uxplay_build:latest .

構建程序

進入 docker 容器開始操作

1
2
3
4
5
@> docker run --rm -it --network host -v $(pwd)/opt cattenlinger/uxplay_build:latest bash
#> git clone https://github.com/FDH2/UxPlay.git
#> cd UxPlay
#> cmake . && make
#> exit

然後就能在當前目錄得到 uxplay 這個 executable 了。拿出來直接用即可。

運行時依賴

要正常運行,還需要一系列 gstreamer 的 lib 才行:

1
2
3
sudo apt install gstreamer1.0-plugins-base gstreamer1.0-libav \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-gl gstreamer1.0-x gstreamer1.0-vaapi gstreamer1.0-tools

簡單運行

現在可以開始運行 uxplay 了。這裏稍微介紹一下基本的參數使用:

1
2
3
uxplay -n 'Name'    # 在 AirPlay 列表裏顯示的設備名
-nh # No hostname, 不要在設備名後面添加 @主機
-s 2160x1440 # 默認分辨率,默認值爲 1920x1080@60

评论