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.
I’m having the same issue - my understaning is that it should work with some more commands (found in <link>)
Blockquote 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.
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.
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.