Webrtcbin, chrome, and h264

Trey Hutcheson trey.hutcheson at gmail.com
Wed Dec 9 19:52:29 UTC 2020


I can't get Chrome to understand or render h264 content sent by another
chrome peer. Honestly I have no idea where the problem is. Here's the
scenario:
* chrome (87) produces an offer with h264 video, sendonly, and connects to
one instance of webrtcbin
* A second remote peer connects to a second instance of webrtcbin. In this
case, webrtcbin produces the offer. I connect video content received from
webrtcbin1 to webrtcbin2, by repayloading (webrtcbin1 > rtph264depay >
rtph264pay > webrtcbin2). Webrtcbin produces an offer with h264 video. The
second chrome peer  responds with an answer, accepting the offer.
* The second chrome peer fires the ontrack event for the new video stream,
but it doesn't actually understand the video. I've attached the stream to a
video element, but it doesn't render. Furthermore,
chrome://webrtc-internals reports "unknown" for the codec and the
decoderImplementation.

Now, to narrow things down, on the server side I have tried taking the
stream received from webrtcbin1 and rendering it onscreen (rtp624depay
! avdec_h264 ! videoconvert ! videoscale ! autovideosink) and it renders
just fine, proving that at the least the rtp is decoded properly and the
h264 decode process produces good video. Thus - the chrome provided video
must be correct.

I've also tried inserting an h264parse element between the depay and
payload elements, and that had no effect.

I have *also* tried depayloading, decoding, re-encoding, and re-payloading,
and that works just fine. Remote side understands the stream.

For the record, I'm using the following code to make chrome provide h264:

const video_transceiver = peer.addTransceiver('video', {"direction":
"sendonly"})
const capabilities = RTCRtpSender.getCapabilities('video')
const noVP8 = capabilities.codecs
    .filter(codec => codec.mimeType.toLocaleLowerCase() != "video/vp8")
    .filter(codec => codec.mimeType.toLocaleLowerCase() != "video/vp9");
video_transceiver.setCodecPreferences(noVP8);

Does anyone have any insight?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201209/bd91fbac/attachment.htm>


More information about the gstreamer-devel mailing list