H.264
On macOS, H.264 comes from the OS’s VideoToolbox and is always offered: Constrained Baseline and High, sent and received, in hardware where the Mac has it.
Elsewhere H.264 isn’t built in. It comes from Cisco’s OpenH264 binary, which webrtc.openh264.install() downloads
to the user’s device and loads. Until then, connections offer VP8, VP9 and AV1 only.
import webrtc
await webrtc.openh264.install() # once, before creating connections
pc = webrtc.RTCPeerConnection()
install() downloads the binary for the platform from ciscobinary.openh264.org once, in a thread, checks it against
a pinned SHA-256, and keeps it in python-webrtc’s cache directory. It sends Constrained Baseline and receives
Constrained Baseline, Baseline, Main and High. On macOS it adds the profiles VideoToolbox doesn’t offer.
Cisco’s Linux binaries need glibc 2.34 or newer: Ubuntu 22.04, Debian 12, RHEL 9 and later. On older systems
install() raises before downloading anything.
webrtc.openh264.disable() stops offering H.264 to new connections, and install() enables it again.
Licensing
OpenH264 Video Codec provided by Cisco Systems, Inc.
Cisco licenses the H.264 patents for its binary, on the conditions of its
license. An application that calls install() meets them when it:
lets its users enable and disable H.264, with
install()anddisable();shows
webrtc.openh264.NOTICE, the line above, where they do.install()prints it. An application that shows it in its own interface can passprint_notice=False, and must then show it there;reproduces Cisco’s license,
webrtc.openh264.LICENSE, where it presents licensing information.
The license covers personal use and uses that receive no remuneration. Services that charge for H.264 content may need
a license of their own from the patent pool. python-webrtc never bundles or builds an H.264 implementation, so without
install() nothing of H.264 is on the user’s device.