fzwoch / obs-teleport

An OBS Studio plugin for an open NDI-like replacement. Pretty simple, straight forward. No NDI compatibility in any form.
GNU General Public License v2.0
445 stars 16 forks source link

Error/Bug hunt help needed: Video freezes and locks OBS GUI but Audio continues to work. #71

Closed fmjensen closed 1 year ago

fmjensen commented 1 year ago

Hello all,

Preface: I got a gamer PC (i7-13700K + GF 2080Ti + 32 GB DDR5 and m.2) installed with OBS (29.0.2), and the latest Teleport plugin (0.6.5). My screen is big - 4587x1920 - and I have configured OBS+ Teleport to forward this video scaled down to 1832x768 in the video settings, using Lanchos.

My streaming PC runs fine with OBS and seems to have no problems coping with this stream. my network can handle the ~350 Mbit data flow between the Gamer PC and the Streamer PC just fine. No lag og packetloss there.

HOWEVER

The OBS Video on my Gamer PC locks up/freezes after a short while every time i try to go live on Twitch. The only solution is to kill OBS from task manager and start it again. but It doesn't help much as OBS just freezes again after wery short while.

If I remove Teleport plugin from my Gamer PC and stream directly from it, everything works like a charm - wich makes me look at Teleport like then child you love but really wanna spank for beeing an annoying PITA ;-)

This setup is complicated to do bug-hunt on so what i really would like is pointers to logs or stuff like logs so I could searce for reasons to this problem.

fzwoch commented 1 year ago

OBS does not do anything special whether you stream or just have it running. So perhaps you are overloading your machine when you start streaming. I haven't had any reports of Teleport causing a deadlock while it is running.

If there is something up it should be noted in the log. Everything else I'm afraid you have to find yourself.

fmjensen commented 1 year ago

Thats what is puzzling me. OBS have never caused me problems before and i have been using Teleport some time. There are no resources in my machine(s) that is overloaded by the setup/configuration i have choosen.

I never had any reason to look in the logs so i didn't know where to find them and just searched the filesystem manually... i now see that was wrong, cause they are accessible from HELP menu inside OBS - Sorry, my bad - should have searched a little more on that simple problem. I will investigate more and return with my findings as soon as possible.

Thank you for a great plugin!

fmjensen commented 1 year ago

I did find som teleport related messages in the logs on the Streaming PC. Here is an excerpt:

Click to expand log text ``` 15:36:17.571: ==== Streaming Start =============================================== 15:38:05.906: [obs-teleport] decode queue exceeded: 5.013333334s 15:38:05.928: [obs-teleport] decode queue exceeded: 5.034666667s 15:38:05.951: [obs-teleport] decode queue exceeded: 5.056s 15:38:05.972: [obs-teleport] decode queue exceeded: 5.077333334s 15:38:05.992: [obs-teleport] decode queue exceeded: 5.098666667s 15:38:06.014: [obs-teleport] decode queue exceeded: 5.12s 15:38:06.034: [obs-teleport] decode queue exceeded: 5.141333334s 15:38:06.057: [obs-teleport] decode queue exceeded: 5.162666667s 15:38:06.077: [obs-teleport] decode queue exceeded: 5.184s 15:38:06.100: [obs-teleport] decode queue exceeded: 5.205333334s 15:38:06.120: [obs-teleport] decode queue exceeded: 5.226666667s 15:38:06.143: [obs-teleport] decode queue exceeded: 5.248s 15:38:06.164: [obs-teleport] decode queue exceeded: 5.269333334s 15:38:06.185: [obs-teleport] decode queue exceeded: 5.290666667s 15:38:06.206: [obs-teleport] decode queue exceeded: 5.312s 15:38:06.227: [obs-teleport] decode queue exceeded: 5.333333334s 15:38:06.248: [obs-teleport] decode queue exceeded: 5.354666667s 15:38:06.271: [obs-teleport] decode queue exceeded: 5.376s 15:38:06.291: [obs-teleport] decode queue exceeded: 5.397333334s 15:38:06.313: [obs-teleport] decode queue exceeded: 5.418666667s 15:38:06.335: [obs-teleport] decode queue exceeded: 5.44s 15:38:06.355: [obs-teleport] decode queue exceeded: 5.461333334s 15:38:06.377: [obs-teleport] decode queue exceeded: 5.482666667s 15:38:06.397: [obs-teleport] decode queue exceeded: 5.504s 15:38:06.419: [obs-teleport] decode queue exceeded: 5.525333334s 15:38:06.441: [obs-teleport] decode queue exceeded: 5.546666667s 15:38:06.461: [obs-teleport] decode queue exceeded: 5.568s 15:38:06.484: [obs-teleport] decode queue exceeded: 5.589333334s 15:38:06.505: [obs-teleport] decode queue exceeded: 5.610666667s 15:38:06.525: [obs-teleport] decode queue exceeded: 5.632s 15:38:06.547: [obs-teleport] decode queue exceeded: 5.653333334s 15:38:43.402: Last log entry repeated for 1727 more lines 15:38:43.402: [rtmp stream: 'adv_stream'] User stopped the stream 15:38:43.402: [rtmp stream: 'adv_stream'] Socket send buffer is 65536 bytes 15:38:43.402: Output 'adv_stream': stopping 15:38:43.402: Output 'adv_stream': Total frames output: 8738 15:38:43.402: Output 'adv_stream': Total drawn frames: 8825 15:38:43.404: ==== Streaming Stop ================================================ 15:38:43.414: [obs-teleport] decode queue exceeded: 42.517333334s 15:38:43.435: [obs-teleport] decode queue exceeded: 42.538666667s 15:38:43.457: [obs-teleport] decode queue exceeded: 42.56s 15:38:43.478: [obs-teleport] decode queue exceeded: 42.581333334s 15:38:43.499: [obs-teleport] decode queue exceeded: 42.602666667s 15:38:43.519: [obs-teleport] decode queue exceeded: 42.624s 15:38:43.541: [obs-teleport] decode queue exceeded: 42.645333334s 15:38:43.562: [obs-teleport] decode queue exceeded: 42.666666667s 15:38:43.585: [obs-teleport] decode queue exceeded: 42.688s 15:38:43.606: [obs-teleport] decode queue exceeded: 42.709333334s 15:38:43.626: [obs-teleport] decode queue exceeded: 42.730666667s 15:38:43.649: [obs-teleport] decode queue exceeded: 42.752s 15:38:43.669: [obs-teleport] decode queue exceeded: 42.773333334s 15:38:43.691: [obs-teleport] decode queue exceeded: 42.794666667s 15:38:43.711: [obs-teleport] decode queue exceeded: 42.816s 15:38:43.732: [obs-teleport] decode queue exceeded: 42.837333334s 15:38:43.754: [obs-teleport] decode queue exceeded: 42.858666667s 15:38:43.775: [obs-teleport] decode queue exceeded: 42.88s 15:38:43.797: [obs-teleport] decode queue exceeded: 42.901333334s 15:38:43.819: [obs-teleport] decode queue exceeded: 42.922666667s 15:38:43.839: [obs-teleport] decode queue exceeded: 42.944s 15:38:43.861: [obs-teleport] decode queue exceeded: 42.965333334s 15:38:43.882: [obs-teleport] decode queue exceeded: 42.986666667s 15:38:43.903: [obs-teleport] decode queue exceeded: 43.008s 15:38:43.925: [obs-teleport] decode queue exceeded: 43.029333334s 15:38:43.947: [obs-teleport] decode queue exceeded: 43.050666667s 15:38:43.968: [obs-teleport] decode queue exceeded: 43.072s 15:38:43.989: [obs-teleport] decode queue exceeded: 43.093333334s 15:38:44.010: [obs-teleport] decode queue exceeded: 43.114666667s 15:38:44.031: [obs-teleport] decode queue exceeded: 43.136s 15:38:44.054: [obs-teleport] decode queue exceeded: 43.157333334s 15:38:55.394: Last log entry repeated for 531 more lines 15:38:55.394: ==== Shutting down ================================================== ```

I do not excately know what they mean. athey are not calle out as errors - but after some tuning of my setup the problem have dissapered.

What i did was changing the downscaling to be done on the streaming PC. I thought it would be better to send the downscaled video (+audio) stream using Teleport to save bandwidth on my LAN. But it gives my setup problems.

So now i send the unscaled 4587x1920 video from my Gaming PC using OBS+Teleport, to my Streaming PC. Here it is downscaled to 2036x852 using Bicubic shapend scaling, 16 samples - and encoded for Twitch using x264, No rescaling, CBR, 6000 Kbps, 2s Keyframe, "veryfast" CPU usage preset, Profil high, no Tune and no extra options.

This satisfies my wishes for streaming quality and stability. You can see some of my resent streams at Twitch if you search for 'CmdrFlemming'

fzwoch commented 1 year ago

That indicates that you are receiving more data than the receiving machine is able to decode. So it may be not fast enough for decoding the stream in real-time. (Or something else in OBS prevents sending the data into OBS, but I doubt)

I wonder how the CPU usage looks like on that system at that point.

But try a down-scaled stream if it affects the behavior.

EDIT: It is weird though that you say it freezes.. indicating that no more data is delivered.. which feels odd.. Another possibility would be if for some reason the audio part drops out (or vice versa)

Reading the first thread once more - I looks like internally something in OBS locks up, Teleport cannot deliver any more frames due to the lockup and therefore its queue grows.

fmjensen commented 1 year ago

I agree that it is odd... and to clarify about the freeze; the video freezes on the twitch channel and on both sending and recieving pc BUT audio continues - the VU meters fluctuate and audio is comming thru all the way.

I suspected that the message was due to congestion on the recieving end - but whats odd is that the problem dissapeared when I send MORE data by NOT downscaling on sending PC.

CPU load on recieving pc is steady on ~60% +- 15%. GPU load is only ~25% but that is because i now use x264 compression on the datastream towards Twitch.

I am not home right now and cant enclose other evidence at this time, but I will examine anything on your request.

fmjensen commented 1 year ago

I will try to recreate the problem with OBS configured to do more verbose logging.

fzwoch commented 1 year ago

You will probably have to debug into OBS and note which threads are running and which is blocking and why. I assume the issue is somewhere to be found there and Teleport may just be the tipping point triggering it.

fmjensen commented 1 year ago

I can't make fail again... so I say wel call it done and close this issue.