-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lack of JitterBuffering on input causes playback issues #21
Comments
With the power of print statements I found out that the |
Updated to the newest commit. The stream doesn't crash anymore on obs' side of things and I get audio, however video is still a black screen. |
I left it running for a bit longer. Audio works fine and I got a single frame transmitted after five minutes. After another five minutes I got around half a second of blurry frames and then the image stuck again. The only thing printed in the log is
|
Sorry @Roger-Roger-debug I haven't responded sooner Are you ingesting video from OBS? Can you lower the bitrate and see if it helps? What are your encoder settings? |
No worries. Yes, I'm ingesting from OBS (latest master) using ffmpeg vaapi h264 as the encoder with a constant bitrate of 2500 Kbps. I did try different settings without success. |
Can you try x264? I am not sure what the problem is, but hoping we can remove some variables. Keyframe Internal - 1 second |
I don't have a good answer on the why though sorry :/ A server along the way or the link itself is congested OR it really has deterministic packet loss? I would try to make everything as small as possible (bitrate/resolution) until it works. Then work backwards from that. This is a weird one for sure :) |
I tried out some more settings (resolution, bitrate) but never got a single frame without heavy artifacts. When I find the time I'll bring the server into my LAN and try out some more stuff to see if it's somehow related to that. |
I have the same behavior – it works locally but remotely (whether self-hosted or https://b.siobud.com/) there's a brief burst of video every few seconds. In my case |
I can publish a webcam stream from Broadcast Box in one tab and watch it back in another tab without issue, so I don't think it's a playback issue. But I also don't think it's solely a problem with OBS because livestream-demo.livekit.io works flawlessly (albeit without audio). Edit: |
It looks like the main difference with Linux is that I have massively more out of order packets. Broadcast Box handles this very poorly compared to LiveKit. If I comment out broadcast-box/internal/webrtc/whep.go Line 168 in 8b218c0
Logically I don't see an issue with timestamps being out of order, but, based on these findings, in the real world clients must rely on timestamps being monotonic with reference to sequence numbers. In any case, shouldn't it be fine to just pass the packets through with the original sequence number? |
@gavtroy Thanks for sharing your workaround! In our experience, it also fixed the visual artifacts similar to those found in the picture further up. However in our case, they happened every minute or so only, not continuously. Even with the code change though, the sporadically appearing visual artifacts are replaced with the stream freezing for around 8 seconds before it catches up... I don't have a proper way to debug the exact problem, which is why I did not open an issue for this yet. Streaming with OBS 30 but also happens with /publish. Only for one user, so it's likely a network configuration/firewall issue. Just wondering if you have similar problems or if your workaround was enough to completely fix all issues for you? |
Broadcast Box is re-stamping the packets for Simulcast. If the viewer switches between layers the Sequence Numbers need to stay in-order. We need a basic jitterbuffer in Broadcast Box. @gavtroy can you easily reproduce? If you can I would love to add one to Pion (and have Broadcast Box use it). Then have you test :) |
Yes it's still an issue for me. I'd be happy to test it out when you have something to try (and after Christmas). |
I had similar problem, where the stream would freeze every few seconds. Using the OBS options above but changing buffer size to 500 seemingly fixed all issues. I also added OBS version: |
This was addressed by aeb4043 @Roger-Roger-debug @jhvst Would you mind testing again? @RedMser do you still see it happening? @gavtroy catch you on discord! It sounds like this doesn't fix your issue though, I think we will have to debug 1:1. I am not sure what I need to improve next |
Did a quick test with flatpak obs and an ssh tunnel to my server which didn't work (but I think didn't work in my original setup to begin with). I can't test more than that for the foreseeable future I'm afraid. |
Yes, the stream still does seem to randomly (every minute or two) freeze for 10-20 seconds, not sure what causes it. |
@RedMser are you using OBS to publish or browser/other tool? |
Using OBS was when we had issues. Did not try browser publish page, but streaming e.g. RTMP or SRT with OBS works fine. Next time we try I'll check the webrtc stats page, OBS stats graphs etc. and see if we notice anything... |
I believe you are hitting obsproject/obs-studio#10564 the next release of OBS will handle it properly. Unfortunately nothing Broadcast Box can do to help :/ |
I've been trying to stream with webrtc for some days now but keep running into the same issue.
First up: I'm on Gentoo. Tried the Flatpak build from the linked site in #20 but that didn't work at all. After that I compiled obs from master, using the submodules on libdatachannel as opposed to native libraries. With this setup I could stream to broadcast-box on localhost and watch it just fine.
Opening port 8080 others could watch my stream as well, and streaming to my public ipv4 address worked without any issues either. However, I want to run broadcast box on my remote server and this is where the issue arises. I copied the files over and executed the same command to start the server but can't get any video to show up. To make sure it's not some issues with blocked ports I made an ssh tunnel forwarding port 8080 to my local machine and have broadcast box running there. Under this setup the stream works again.
I don't understand why it only works when the server is running my local machine. Both machines used the same command to start it (
INCLUDE_PUBLIC_IP_IN_NAT_1_TO_1_IP=yes UDP_MUX_PORT=8080 APP_ENV=production go run .
), using the same files and have the same go compiler running it.My friend used the windows build from the linked issue and streamed to the same addresses I did, with the same results. When I could stream he could too, and when it was broken for me it was broken for him. The only difference was when we tried using https://b.siobud.com/, where his stream worked and my stream only had audio.
The text was updated successfully, but these errors were encountered: