UE4.27 linux云服务器像素流部署(2)

一、UE4.27 linux 像素流示例项目

     按照官方像素流示例演示 https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Extras/Containers/Examples/PixelStreaming

     

        访问UE github 源码容器内容更新较慢,缺少一些配置文件 ,通过开发容器可以复制出最新的文件

docker ps
CONTAINER ID   IMAGE                                                             COMMAND   CREATED          STATUS          PORTS     NAMES
6201ee56eb81   registry.cn-shenzhen.aliyuncs.com/nailcloud/ue4:dev-slim-4.27.1   "bash"    48 minutes ago   Up 48 minutes             boring_wilesdocker cp 6201ee56eb81:/home/ue4/UnrealEngine/Engine/Extras/Containers /home/ue4/Containersroot@iZwz95g7tyywrrkk6z5sh1Z:~# ls /home/ue4/Containers/Examples/PixelStreaming/
docker-compose.yml  project  run.sh

      docker-compose.yml  信令服务器更改成阿里云分享的镜像

root@iZwz95g7tyywrrkk6z5sh1Z:/home/ue4/Containers/Examples/PixelStreaming# cat docker-compose.yml
services:# The WebRTC TURN server (note that you will need TCP and UDP ports 3478 and 49152-65535 exposed for TURN relaying to function correctly)turnserver:image: "coturn/coturn:4.5.2"init: truenetwork_mode: "host"command: ["-a", "-v", "-n", "-u", "user:password", "-p", "3478", "-r", "default-realm", "--no-dtls", "--no-tls"]# The Cirrus signalling serversignalling:image: "registry.cn-shenzhen.aliyuncs.com/nailcloud/ue4:pixel-streaming-signalling-server-4.27"init: truenetwork_mode: "host"command:- "--publicIp=${PUBLIC_IP}"- >---peerConnectionOptions={"iceServers":[{"urls": ["stun:stun.l.google.com:19302"]},{"urls": ["turn:${PUBLIC_IP}:3478"],"username": "user","credential": "password"}]${EXTRA_PEERCONNECTION_OPTIONS}}depends_on:- turnserver# The Pixel Streaming demo projectproject:image: "pixel-streaming-example/project"build:context: projectargs:RELEASE: "${UNREAL_ENGINE_RELEASE}"network_mode: "host"depends_on:- signallingdeploy:resources:reservations:devices:- driver: nvidiacapabilities: [gpu]count: 1

        /project/Dockfile    开发镜像和运行时镜像更改成阿里云分享的镜像

root@iZwz95g7tyywrrkk6z5sh1Z:/home/ue4/Containers/Examples/PixelStreaming/project# cat Dockerfile
ARG RELEASE
FROM registry.cn-shenzhen.aliyuncs.com/nailcloud/ue4:dev-slim-4.27.1 as builder# Clone the source code for the example Unreal project
RUN git clone --progress --depth=1 'https://gitlab.com/ue4-test-projects/4.26/firstpersoncxx.git' /tmp/project# Enable the Pixel Streaming plugin in the example Unreal project
RUN sed -i 's|"Modules"|"Plugins": [{"Name": "PixelStreaming", "Enabled": true}],\n\t"Modules"|' /tmp/project/FirstPersonCxx.uproject# Package the example Unreal project
RUN /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun \-clientconfig=Development -serverconfig=Development \-project=/tmp/project/FirstPersonCxx.uproject \-utf8output -nodebuginfo -allmaps -noP4 -cook -build -stage -prereqs -pak -archive \-archivedirectory=/tmp/project/dist \-platform=Linux# Copy the packaged project into the Pixel Streaming runtime image
FROM registry.cn-shenzhen.aliyuncs.com/nailcloud/ue4:runtime-pixel-streaming-4.27
COPY --from=builder --chown=ue4:ue4 /tmp/project/dist/LinuxNoEditor /home/ue4/project# Set the project as the container's entrypoint
ENTRYPOINT ["/home/ue4/project/FirstPersonCxx.sh", "-RenderOffscreen", "-Windowed", "-ForceRes", "-ResX=1920", "-ResY=1080", "-PixelStreamingIP=127.0.0.1", "-PixelStreamingPort=8888"]

      执行./sh,显示像素流启动正常

      Google Chrome 访问公网ip+端口测试网页访问是否正常

 


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部