Changing [video] resolution for PixelStreaming

Welcome to the great “Video Resolution for Pixel Streaming” topic :).

The ongoing challenge is to have a video streaming resolution that is in line with (or equal to) the rendered game resolution.

There are quite a few forum posts around this topic. Here you will find them summarized so we can hopefully all use one resource.

UE Version Summary

  • 4.26:
    Everything works fine. Video resolution is updated automatically after r.setRes command
  • 4.27:
    Video resolution is captured on creation of webRtc Player and not updated afterwards.
    Forum Posts on the topic: (link1) (link2) (link3)
    Automatic or manual updating can be re-enabled or with commands:
Automatic:
PixelStreaming.WebRTC.DisableResolutionChange false
PixelStreaming.Capturer.UseBackBufferSize true
Manual:
PixelStreaming.WebRTC.DisableResolutionChange false
PixelStreaming.Capturer.UseBackBufferSize false
PixelStreaming.Capturer.CaptureSize *target resolution*
  • 5.0:
    Video resolution is captured on creation of webRtc Player and not updated afterwards. The commands to enable it (in 4.27) have been removed.
    See (link) (section ‘Pixel Streaming’) for details on the updates in UE5.0
    Forum Posts on the topic (link1) (link2)

UE5-0 Workarounds
Currently there are no known workarounds for the issue, short of setting a resolution, refreshing the page and loging in again. We hope that a discussion in this forum topic with bring us a solution.

UE5-0 Solutions to explore
So far the most promising solution seems

Running the following functions in sequence (from app.js) does results in the player restarting with a fresh stream:

webRtcPlayerObj.close();
connect();
playVideoStream();

But…!

  • This doesn’t work if you change resolution before running the functions. No video appears on the screen.
  • Running the functions repeatedly results in severe performance degradation. Refreshing the browser resolved this.
  • adding ws.close() to the sequence forces the user to click on the screen before video resumes, but strangely also shows 2 parallel streams in the stats section of the browser

I’m hoping that we can come up with a working solution together!