diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs index 2f94b1c6..262ad11b 100644 --- a/net/webrtc/src/webrtcsink/imp.rs +++ b/net/webrtc/src/webrtcsink/imp.rs @@ -3035,7 +3035,18 @@ impl BaseWebRTCSink { .iter_mut() .for_each(|(_, stream)| { if stream.sink_pad.upcast_ref::() == pad { - stream.in_caps = Some(e.caps().to_owned()); + // We do not want VideoInfo to consider max-framerate + // when computing fps, so we strip it away here + let mut caps = e.caps().to_owned(); + { + let mut_caps = caps.get_mut().unwrap(); + if let Some(s) = mut_caps.structure_mut(0) { + if s.has_name("video/x-raw") { + s.remove_field("max-framerate"); + } + } + } + stream.in_caps = Some(caps.to_owned()); } }); }