Question / Help "0" delay stream to FFPlay (FFMPEG) required!

HeartOfGermany

New Member
Hello. I have a Problem, that is hard to fix... I need to Stream my Monitor to the ffplay.exe with as low lag as possible. That means: If ffplay would send keyboard and mouse input, it should feel at least almost as fluid as just doing it on the real monitor.

Why? I need to record the screen and than play it on a second screen with the left side of image cropped. I already reduced the lag in ffplay with the following command:

START C:\Users\Ultron\Downloads\rescale\ffmpeg\bin\ffplay -probesize 40 -i udp://224.0.0.1:9999 -vf "scale=0.5*iw:-1"

- probesize 40 just reduces the buffer size to a bare minimum. Just enough, so it even can play the stream at all!

40 or 200 does not make a noticeable difference btw.

Well... If I test it, it has a delay of around 500ms. So for a live picture this absolutely is unusable! I cannot allow any more than 50ms delay. This is the max that can work for me!

Is there a way, to increase the rendering speed as frick? I mean, since the stream is on the local machine per the public broadcast domain/IP, there is no bottleneck in transfer speed - so I do not care about a raw video or a lossless compressed video at all.

Why that all? If I tell, you call me absolutely heck of insane. So please do not ask. :D ;)


Very important: I do not care, what kind of solution I use, but I want to be able to stream absolutely anything, even HDCP content (even though it is not important for my purpouse I guess). At least a fullscreen game and the desktop with browser and more needs to be streamable.
NVIDIA Gamestream (Geforce Experience) has an ultra low latency. This would be plenty for my purpouse. But there are problems:

- I need to be able to play the stream 2 times at the same time, also on the same PC (yes, absolutely required!); Nvidia Gamestream can only be viewed 1 Time, since it actually is intended to be a local, low latency, remote desktop app basically.
- I need to be able to crop the video > like with the command I posted early (Gamestream cannot be cropped - it is just 1:1 output, since it is within an app)



What I did so far:
- OBS is streaming via "Record" - mode. The file output path is the local broadcast IP (=stream)
- Codec:
*FFMPEG output to URL
*15000kbps (looks good enough, changing to 150 only does not improve latency!)
*keyframes - does not affect latency
*hevc_nvenc (nvenc_hevc) >> = Nvidia hardware rendering??? I use GTX 1060 by the way.
*Audio - does not matter, latency unaffected


So now I am out of ideas... What to do? There are like a hundret of codecs to select. Which one is good for my usecase?

If I want to start the streaming, I press record. Just execute the command, I posted above, this plays back the stream in ffplay - but about 500ms delayed...



Thanks!

Edit: I edited the FPS from 30-60 with a considerable improvement. Now like 100ms only. How to increase beyond 60fps?

> https://obsproject.com/forum/threads/obs-144fps.93940/

3rd post there is a link, that shows a stream with 144fps (or 143 to be exact). How do I do that? I cannot find a cfg file in the install directory...

Edit 2: Found it - got 120 to work. Yet better delay. Still, to bad for any gaming whatsoever.
 
Last edited:

carlmmii

Active Member
I am.... very confused as to why the necessity for so many local streams.

Is there any reason you can't just use a scene that has the capture cropped, full screen previewed to the screen that you're playing on?
 

HeartOfGermany

New Member
Unfortunately I need the ability, to crop a stream. Basically I want to play the left side of stream 1 on Monitor 2 and right side of stream on Monitor 3. It needs to be of low latency, so I have the ability to play with the video output on monitor 2 and 3. I would be happy, if I could fullscreen in windows to 2 Monitors, but without NVIDIA Surround this does not work at all. Nvidia Surround only works with SLI or a small selection of GPUs. I absolutely do not want a 2nd GPU. This is also down to power wastage, not only money wastage.

So the only way to fullscreen to 2 Monitors is, to fake a 3rd Monitor (first monitor in my case) with 3840x1080 and mirror the left and right side on separate screens. Only with that it is possible for me, to get a fullscreen window, that spreads over 2 Monitors. The only problem with this solution so far is the lag.

So yeah, whatever solution it might be, I need 3 Monitors, 1 fake, 2 real. Fake one is twice the width, real ones are just 1080p. I know, this absolutely makes no sense for a shooter. That does not matter for me. If someone finds a solution, I will donate 15$ (US) via PayPal to him! 50ms max!

The solution also shall be working on any system with 3 or more video output ports, preferably even AMD (This setup is not specific to my PC, if I get it working, I definitely will post a Video of the result on YouTube. Without a spoiler, why I need that, if it works, you will be amazed by what I want to archive... ;)


Edit:
It is also preferable, if this can be set up with 1 Click on a batch file (.bat) - command line basically.
 
Top