Repeated log “RTC::Producer::ReceiveRtpPacket() | key frame received” when use ffmpeg to push stream

Hi ibc,

When i use ffmpeg to do h264 stream rtp-packetize and push to mediasoup server for a realtime streaming scenario, i see the repeated logs:

 mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:10064] +1s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:10368] +1s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:10617] +1s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:11071] +2s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:11249] +867ms
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:11390] +879ms
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:11587] +1s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:11761] +1s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:11960] +1s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:12326] +1s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:12683] +2s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:13035] +2s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:13167] +971ms
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:13358] +1s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:13598] +935ms
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:13956] +1s
  mediasoup:Channel [pid:3549] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:22222222, seq:14478] +2s

i thought ffmpeg does not do RTCP PLI feedback from source, (it may do SR, because there is in ffmpeg’s code), while checking libwebrtc’s impl, libwebrtc seems do encode keyframe realtime to response to RTCP PLI request.

does it affect the webrtc end2end latency? The input source is assumed to be realtime-encoded h264 stream, which doesn’t do any webrtc/rtp-related things.

What you see is that ffmpeg creates a key frame roughly every second. Either your source has that or transcoding parameters are configured to produce such GOP. So it probably has nothing to do with PLI in this case.

Yes, i’ll try to re-encode the h264 stream to decrease the GOP parameter.

What i’m wondering is, does this has negative affect on streaming latency? I’m using this for cloud gaming, e2e latency would be better <200ms, so just ask.

Not on latency but on generated bitrate which is much higher if a key frame is sent to often.

1 Like