Skip to content

Commit

Permalink
obs-webrtc: Increase RtcpNackResponder size
Browse files Browse the repository at this point in the history
Before we used the default value set by libdatachannel. At
higher bitrates the cache would be undersized. Because of the undersized
cache we wouldn't have enough NACK history to fix the stream.
  • Loading branch information
Sean-Der committed May 16, 2024
1 parent 7843a82 commit 95e1a63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/obs-webrtc/whip-output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const uint8_t audio_payload_type = 111;
const char *video_mid = "1";
const uint8_t video_payload_type = 96;

// ~3 seconds of 8.5 Megabit video
const int video_nack_buffer_size = 4000;

WHIPOutput::WHIPOutput(obs_data_t *, obs_output_t *output)
: output(output),
endpoint_url(),
Expand Down Expand Up @@ -121,7 +124,8 @@ void WHIPOutput::ConfigureAudioTrack(std::string media_stream_id,
rtc::OpusRtpPacketizer::DefaultClockRate);
auto packetizer = std::make_shared<rtc::OpusRtpPacketizer>(rtp_config);
audio_sr_reporter = std::make_shared<rtc::RtcpSrReporter>(rtp_config);
auto nack_responder = std::make_shared<rtc::RtcpNackResponder>();
auto nack_responder = std::make_shared<rtc::RtcpNackResponder>(
video_nack_buffer_size);

packetizer->addToChain(audio_sr_reporter);
packetizer->addToChain(nack_responder);
Expand Down

0 comments on commit 95e1a63

Please sign in to comment.