Pixel Streaming video resolution issue since 4.27

Hello, I am a long time user of PixelStreaming. I came upon an issue since using version 4.27. When accessing my PixelStreaming Application via browser, the App’s resolution is set to match the Browser’s resolution via command emitUIInteraction({ConsoleCommand: 'r.SetRes 1000x500'});

This commands works like it is supposed to (inner implementation inside the UE4 is just to change resolution based on the values provided). Since 4.27, the resolution of the App is changed, but the Video that is being streamed to the Browser maintains it’s former resolution. I also checked via the default SignallingServer implementation, where you can look at some stats and the resolution indeed stays the same. Also the “Match Viewport Resolution” option is not working at all.

Has anybody experienced the same issue? That the “Video” does not match the App’s resolution? It looks like from 4.26 → 4.27 there was a edit of somethings that checked and updated the streamed video size based on the App’s resolution, which is now missing.

Edit: I think this is the same problem as described in this thread: Can't change video resolution in PixelStream

I’m having the same issue - my understaning is that it should work with some more commands (found in <link>)

PixelStreaming.Capturer.UseBackBufferSize false
PixelStreaming.WebRTC.DisableResolutionChange false
Then, when you want to update the resolution later, use
PixelStreaming.Capturer.CaptureSize 1920x1080
And, if you also want the render resolution to match, use
render.SetRes 1920x1080
as well.

However… this solution appears to be broken as of 4.27.1. Right now I’m making a bug report for this. Hopefully it’s fixable soon because Pixel Streaming is losing a lot of appeal if it’s impossible to change resolution.

Oooowww yes… I found a solution to this (and it’s so simple I want to bang my head on the table):

You have to run

PixelStreaming.WebRTC.DisableResolutionChange false

BEFORE anyone logs in, so just put it in an ExecuteCommand node in your PlayerController at BeginPlay and you should be good to go!

Just want to leave a quick note on UE5 updates:

The following commands do no longer exist (but are needed to change resolution ‘on the fly’:

  • PixelStreaming.WebRTC.DisableResolutionChange
  • PixelStreaming.Capturer.CaptureSize
  • PixelStreaming.Capturer.UseBackBufferSize

If someone has found some workaround for this, I’d be very happy to hear about it!

edit: here’s a link to a more centralized discussion on the topic

Hey guys!

I’m here to help shed a bit of light on the issue,

So the lack of stream resolution changing in Pixel Streaming in UE 5.0 - 5.0.3 is a known regression. With the changes needed to fix the issue, it couldn’t quite make it into the hot-fix release, much to our chagrin.

Good news however, is that it is already fixed in the ue5-main branch on Github!

Sorry for the inconvenience, but know that we’re aware and tackling these issues.

Hi Guys,

Incase anyone else is here looking for a solution I’ve found out a few things that might be able to help you until these commands are back in. Its a bit of a hack but an easy one to do!

So a couple things to point out:

  • In order for the r.SetRes command to work, the unreal instance must be in windowed mode so make sure to add the -Windowed parameter on your game’s shortcut
  • Currently there is a bug in calculating the size of the video in the frontend of the pixel streaming. Inside app.js line 1140 it calculates the video’s aspect ratio by grabbing the video element and getting its size. This doesn’t work as the video element has to be referenced using an index so using videoElement[0].videoHeight would actually get the video height. However, this issue actually helps us as we want the outcome of videoAspectRatio to be NaN. That way it sets the style of the video container to be the size of our window

So, now the fix. Currently, if you have the window resizing, the video is distorted as its trying to fit its original aspect ratio. One change in the CSS will allow for the video to be stretched to fill the screen and therefore counter the distortion caused by the video. Inside Public/player.css add on line 54 (inside the video class) object-fit: fill; this will allow the video to stretch inside the video container which is the same size as the instance’s viewport

A lot of scouring into the signalling server code went into this, and I hope this fix helps people for the time being until the right commands are in.

Hi @MWillWallT,

I was wondering if you’d be able to provide us with an ETA on the release of 5.0.4 which I presume would have this fix?

Also do you have a PR link to what fixed this issue?

Many Thanks