webrtc 关键帧请求分PLI,SLI,FIR。但是有何区别?
PLI 是Picture Loss Indication
图片丢失提示消息表明突发性的丢包影响到了一个或多个帧中的多个包。发送方可以通过重传这些包或者生成一个新的I帧以作出回应。但一般来说,PLI同时表现得像一个NACK和一个FIR,因此,通过使用PLI,接收端为发送端如何对该请求作出响应提供了更大的灵活度
SLI 是Slice Loss Indication。
切片丢失提示消息表明该包丢失影响到单个帧的部分(即,多个macroblock)。因此,当发送端接收到SLI消息时,它可以通过重新编码的方式纠正切片,停止部分帧解码错误的传播。
发送方接收到接收方反馈的PLI或SLI需要重新让编码器生成关键帧并发送给接收端。
FIR 是Full Intra Request
视频在WebRTC的会话中总是以一个I帧开始,然后发送P帧。但是,当有新的参与者中途加入会议会话时,很有可能接收到一系列P帧,但因缺少相应的I帧,它并不能解码。这种情况下,该接收端会发送一个FIR以请求一个I帧。
到底说了什么,处理有什么区别?没看懂
webrtc的处理如下:
// Holding no Critical section.
void RTCPReceiver::TriggerCallbacksFromRtcpPacket(
const PacketInformation& packet_information) {
......
// We need feedback that we have received a report block(s) so that we
// can generate a new packet in a conference relay scenario, one received
// report can generate several RTCP packets, based on number relayed/mixed
// a send report block should go out to all receivers.
if (rtcp_intra_frame_observer_) {
RTC_DCHECK(!receiver_only_);
if ((packet_information.packet_type_flags & kRtcpPli) ||
(packet_information.packet_type_flags & kRtcpFir)) {
if (packet_information.packet_type_flags & kRtcpPli) {
RTC_LOG(LS_VERBOSE)
<< "Incoming PLI from SSRC " << packet_information.remote_ssrc;
} else {
RTC_LOG(LS_VERBOSE)
<< "Incoming FIR from SSRC " << packet_information.remote_ssrc;
}
rtcp_intra_frame_observer_->OnReceivedIntraFrameRequest(local_ssrc);
}
......
}
PLI,FIR调用了同样的请求编码器生成关键帧
void EncoderRtcpFeedback::OnReceivedIntraFrameRequest(uint32_t ssrc) {
RTC_DCHECK(HasSsrc(ssrc));
{
int64_t now_ms = clock_->TimeInMilliseconds();
MutexLock lock(&mutex_);
if (time_last_intra_request_ms_ + min_keyframe_send_interval_ms_ > now_ms) {
return;
}
time_last_intra_request_ms_ = now_ms;
}
// Always produce key frame for all streams.
video_stream_encoder_->SendKeyFrame();
}
到底怎么样,还得继续分析