Closed iesv closed 1 year ago
Set Max B-Frames to 0, and if using NVENC, disable Look-Ahead. It's simply not supported by WebRTC as stated.
Thank you!
Also, if you get no audio over WebRTC, that's because it can't handle AAC. You'll need to script over Opus conversion to ffmpeg and remux the stream. You can probably do this with runOnReady in rtsp-simple-server but I haven't got it to work for me yet. Probably misunderstanding it, myself. Anyway, you're welcome! You could of course use ffmpeg custom output in OBS with Opus audio, but this'll give you less fine-grained control over the NVENC encoder compared to the built-in settings. Then you'd have to use a stream format that can carry Opus over to rtsp-simple-server, as rtmp cannot. It's kind of a mess. :P
I was able to get it working with this in runonready:
runOnReady: ffmpeg -i rtsp://localhost:$RTSP_PORT/$RTSP_PATH -vcodec copy -c:a libopus -f rtsp rtsp://localhost:$RTSP_PORT/compressed
Hello all, I was never able to make a video with B-frames work with WebRTC, so i'm assuming that it is not supported at all, but i may be wrong, and if someone finds a technique or a software that supports it i'm ready to upgrade the server.
Anyway, videos with B-frames work correctly with Low-Latency HLS, therefore you can achieve a latency lower than 1s by using a different protocol.
Set Max B-Frames to 0, and if using NVENC, disable Look-Ahead. It's simply not supported by WebRTC as stated.
Is there an explicit setting in OBS for these two? Can you send me a screenshot as it was not obvious to me where this needs to be set
Also, another pion-based project called broadcast-box is able to handle/decode obs whip input just fine and has a whep player. How are they handling the B-Frames?
https://github.com/Glimesh/broadcast-box https://github.com/obsproject/obs-studio/commit/851a8c216e14617fb523951839f3bdb240e85141
@saket424 you're referring to the latest OBS code that allows to publish with WebRTC, while this issue is related to publishing with RTMP. In OBS, when WebRTC is used in place of RTMP, B-Frames are automatically disabled, take a look at this line:
Therefore broadcast-box doesn't handle B-frames at all.
I just wanted to add that if you are using local development and just want to remove B-frames from a video, you can do:
ffmpeg -i sp1.mp4 -c:v libx264 -bf 0 sp1_no_bf.mp4
This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.
Which version are you using?
v0.21.0
Which operating system are you using?
Describe the issue
WebRTC doesn't support H264 streams with B-frames by using OBS steam.
Describe how to replicate the issue
Did you attach the server logs?
yes / no
Did you attach a network dump?
yes / no