隨筆記錄一些 UE4的Pixel Streaming開發中常遇到的問題,不定期更新.
Note:非工業卡最大只能運行兩個實例!非工業卡最大只能運行兩個實例!非工業卡最大只能運行兩個實例!
PixelStreaming本質是兩個比較簡單的NodeJS的Express 服務器 + UE4 WebRTC的代理(SignallingWebServer的cirrus.js和Matchmaker的matchmaker.js)
快速索引:
Pixel Streaming 不支持A卡(AMD not Yes)
Pixel Streaming文檔:
https://docs.unrealengine.com/en-US/Platforms/PixelStreaming/CustomPlayer/index.html
Pixel Streaming 單機GPU性能和理論最大模擬數量介紹:
https://developer.nvidia.com/nvidia-video-codec-sdk#NVENCFeatures
Pixel Streaming支持顯卡型號和顯卡最大模擬推送數量:
https://developer.nvidia.com/video-encode-decode-gpu-support-matrix#Decoder
超分辨率模擬(DSR):
https://www.geforce.cn/hardware/technology/dsr
Q.常用的設置和修改優化:
html文件 meta 修改,看需求使用/主要是防止移動端/pad多指操作的問題:
<meta name="apple-mobile-web-app-title" content="你的標題"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/> <!-- 防止touch放大和移動網頁 --> <meta name="format-detection" content="telephone=no"/> <meta name="screen-orientation" content="landscape"> <!-- 強制橫屏/移動端方向 --> <meta name="x5-orientation" content="landscape"> <!-- 強制橫屏/移動端方向 --> <meta name="full-screen" content="yes"> <!-- 全屏--> <meta name="x5-fullscreen" content="true"><!-- 全屏/瀏覽器兼容 --> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="apple-mobile-web-app-capable" content="not" /> <!-- 工具欄 -->
啟動項參數:
-AudioMixed -AllowPixelStreamingCommands -RenderOffScreen -NvEncH264ConfigLevel=NV_ENC_LEVEL_H264_52
AudioMixed :必需。
AllowPixelStreamingCommands :允許用emitcommand發送 UE4控制台命令
RenderOffScreen:后台運行
NvEncH264ConfigLevel=NV_ENC_LEVEL_H264_52:高分辨率必須添加本參數,否則回報nv錯誤.
Q.PixelStreaming自動適配各個屏幕分辨率問題:
先前准備工作:
必須啟用 NvEncH264ConfigLevel=NV_ENC_LEVEL_H264_52和 AllowPixelStreamingCommands --- 允許用emitcommand發送 UE4控制台命令
當程序分辨率大於UE4運行服務器系統當前分辨率時,UE4的UI系統超出當前分辨率的部分將無法被觸發和點擊(目前暫時不清楚有沒有其他解決方案/沒特別細的去研究這塊)
運行服務器需要開啟DSR超分辨率功能,解決上述問題
Note:DSR目前1080P屏最高也就能開啟2K分辨率,剛好夠支持IPad 的2k分辨率(2732x2048)
DSR開啟:
Javascript代碼部分修改/實現根據屏幕瀏覽器分辨率設置系統分辨率:
修改webRtcPlayer.js:
// 發送命令,實現自己的功能 start let descriptor = { ConsoleCommand: 'RestartLevel', Resolution: { Width: window.innerWidth, Height: window.innerHeight } }; emitCommand( descriptor ); // 發送命令,實現自己的功能 end
Q.IOS/IPad 內嵌WebView的問題:
wait