LS3solutions / openstream-server

GNU General Public License v3.0
201 stars 26 forks source link

Open-Stream defaults to second monitor and there is no way to change it #6

Open cyb0rg56 opened 3 years ago

cyb0rg56 commented 3 years ago

This is using the h.265 encoder. the h.264 AMD VCE/AMF option gives me a black/frozen screen when using vita moonlight client

TsukikoChan commented 3 years ago

I got amd-h265 to work albeit it appeared to have a larger latency than software h265 on vita-moonlight. I had to jump through a few hoops to get it to work. I had to disable both my second and third monitors during my attempts (leaving main monitor on and set at 720p res) to get the streams to work, else it is blackscreen as you say. Even during loading of BigPicture, the non-primary monitors flashed a few times before it all settled down in 10 seconds at what i assume to be 720p res.

So, I'm taking it that having more than one monitor enabled or extended onto in Windows actually breaks streaming on OpenStream (only tested on vitamoonlight so far) on both software h264/h265 and amd h264/h265 using latest K-lite pack as of today (on ryzen 6800x and vega64, main monitor is 1440p).

cyb0rg56 commented 3 years ago

I got amd-h265 to work albeit it appeared to have a larger latency than software h265 on vita-moonlight. I had to jump through a few hoops to get it to work. I had to disable both my second and third monitors during my attempts (leaving main monitor on and set at 720p res) to get the streams to work, else it is blackscreen as you say. Even during loading of BigPicture, the non-primary monitors flashed a few times before it all settled down in 10 seconds at what i assume to be 720p res.

So, I'm taking it that having more than one monitor enabled or extended onto in Windows actually breaks streaming on OpenStream (only tested on vitamoonlight so far) on both software h264/h265 and amd h264/h265 using latest K-lite pack as of today (on ryzen 6800x and vega64, main monitor is 1440p).

oh nice dude! i'll see if i can replicate your setup and get it to work too. I should be able to as i am using a AMD R9390, an i5 4690k and my main monitor is also 1440p

TsukikoChan commented 3 years ago

Hopefully detaching monitors will help you, I'm unsure if the 390 can do amd's h264/h265 encoding, might be only software will work for you.

I'm currently experimenting with 12noon's Display Changer to create scripts that will detach my sidemonitors and resize my main monitor down to 720p, and a restore script that reattachs my side monitors (with correct res and orientation) and my main monitor with 1440p144 10bitcolour again. It's nearly working.

I might use this with these scripts to force a 720p single display for streaming until OpenStream can resize and handle multi-monitors fully.

Uka-Uka commented 3 years ago

Interesting! Thanks, @TsukikoChan! for sharing your experience.

I'm having this black screen issue too with moonlight-qt as described here #8, it mentions something about being not able to change display topology, I've tried pretty much everything, but I didn't come to my mind to change the display resolution, I'm giving this a try. I use a single monitor setup BTW.

As for the codecs stuff, looks like you've been tinkering with h264 and HEVC, In your opinion, what are the optimal settings for having as low latency as possible? have you also tested VP9 performance?

TsukikoChan commented 3 years ago

Hi Uka, I haven't played with the codec settings to optimise latency, mostly just playing with software h265 (my 5800x can handle it i think) at 720p60 resolution. I'll probably dig into that once i get the connection more stable.

It looks like for me (at least on vita-moonlight) that it can handle decoding of 720p content sent using h265 (though that might be why i'm getting random stream drops) and at 720p i feel like there's very little latency on my latest tests.

for vita-moonlight, my settings are currently set at 960x544/60, bitrate10000, yes for performance game settings, no for frame invalidation, optimisation and vblank, yes to framepacer and local audio. (and also yes to show fps atm). I may play with these settings to make the stream more stable.

one other thing to play with maybe for your black screens is to maybe change the screen to 8bit colour, no hdr (i'm unsure if that will break it) and 720p resolution (i couldn't change to vita native res but 720p seems ok so far).

TsukikoChan commented 3 years ago

oh, other thing i'm using is the version of openstream from their site, alpha-2312.1 i think if that helps.

m4rkoup commented 3 years ago

h264-h265 CPU encoders have hard times working with 1080p or greater. @TsukikoChan has a point when mentions 720p.

mirh commented 3 years ago

1080p x264 shouldn't be that hard to run on any recent cpu. If you have some beast HEDT platform, you could probably even keep up with realtime 4K60.

TsukikoChan commented 3 years ago

Hi @m4rkoup Will it be possible to get the openstream to work with multimonitor setups in the future without needing to disconnect the side displays? My guess for both me and @cyb0rg56 is that openstream tries to move to a single screen but (looking at my monitors during this) it looks like the side monitors don't get disconnecting but duplicated, so it's possible openstream's blackscreen in this case is coming from one of the secondary monitors and it's not capturing the primary monitors?

I know i can get around this by disconnecting my secondary monitors but I hope this can be done without needing to do that in the future.

TsukikoChan commented 3 years ago

Oh, just to help out too. Since Openstream works on a single monitor, and streams easier on a 720p display, i created scripts for using the DisplayChanger application to turn off my side monitors and change res to 720p and a script to revert it back to normal setup if anyone is interested (my side monitors are rotated so it took a while to get the right resolutions and offset values to work). I think I could attach these as pre- and post- cmds in the apps_windows.json file to run before and after starting certain apps. I need to investigate this.

GoTo1Monitor.bat: `@echo off

REM setting to single screen

echo Disabling Screens and 720p

cd "C:\Program Files (x86)\Display Changer\"

dc64cmd.exe -monitor="\.\DISPLAY3" -detach

dc64cmd.exe -monitor="\.\DISPLAY2" -detach

dc64cmd.exe -monitor="\.\DISPLAY1" -width=1280 -height=720 -refresh=60 -primary`

RestoreMonitors.bat: `@echo off

REM setting to single screen

echo restoring Screens

cd "C:\Program Files (x86)\Display Changer\"

dc64cmd.exe -monitor="\.\DISPLAY1" -primary -max

dc64cmd.exe -monitor="\.\DISPLAY2" -secondary -right -lx=-900 -width=1440 -height=900 -rotate=left

dc64cmd.exe -monitor="\.\DISPLAY3" -secondary -left -lx=2560 -width=1440 -height=900 -rotate=right`

nlz242 commented 2 years ago

Same issue, using moonlight on an Android TV. Open Stream only streams my second monitor (non-default) and games launch (and often have no option to specify) on the "Primary" monitor. Having an option in Open Stream to specify which monitor should be streamed, would be great!