Repository navigation
feat: build WebRTC with H.265 - #346
Merged
Merged
Conversation
WebRTC was built without H.265 (rtc_use_h265 follows proprietary_codecs, which is off), so a call could not carry it even with an encoder and a decoder for it: no H.265 packetization, no depacketizer (WebRTC creates none and drops the stream) and no H.265 negotiation. It is now built with rtc_use_h265=true, and the JNI code with RTC_ENABLE_H265 to match. WebRTC has no H.265 codec of its own and none is added, so H.265 is offered only by a factory that brings one. A compiled WebRTC is used only if it was built with the current GN args, which are recorded next to the library in the build tree and the install directory. A build without the record or with other args is built again, and the stale installed library is removed so nothing links it meanwhile. Before, any existing library was taken as it was, so a change to the args never reached a machine that had built WebRTC once. The record is written only when gn and ninja succeed. Java encoders get the QP of H.265 frames parsed, and the H.264 quality scaling thresholds for H.265, as WebRTC's Android wrapper has them. A new test sends a call through a Java H.265 encoder and decoder, whose frames are wrapped in H.265 NAL units.
devopvoid
added this pull request to stack #349
October 11, 2026 13:02
SendableMetatype
added a commit
to EduGeyser/webrtc-java
that referenced
this pull request
Oct 15, 2026
Brings in the work upstream added from October 11 to 15: hardware video codecs on every platform, through Media Foundation, VideoToolbox, VA-API and NVDEC, with WebRTC built with H.265 (devopvoid#346 to devopvoid#348, devopvoid#352, devopvoid#353, devopvoid#356, devopvoid#359, devopvoid#371 to devopvoid#377); HEVC and AV1 decoding in the media player, with dav1d and Vulkan Video (devopvoid#331, devopvoid#345); encoded frame injectors (devopvoid#365); receiver source changes and audio packet infos (devopvoid#366); audio codec factories (devopvoid#340); network thread observers called on a callback thread (devopvoid#364); screen capture with ScreenCaptureKit (devopvoid#354); Windows audio devices that mix more than two channels (devopvoid#358); autoninja (devopvoid#357); and the release channels of the docs site (devopvoid#361). Fork-side adaptations: - The factory keeps the CreatePeerConnectionFactory overload without a worker thread, and still switches device capture on the network thread. devopvoid#355 copies WebRTC's factory setup and has the audio module learn a worker thread, which only matters for a worker thread distinct from the network thread, and WebRTC is removing those. The audio codec factories and hardware codec switches of devopvoid#340 and devopvoid#359 go to that overload. - WebRTC stays on a commit on main, so the move to branch 8059 (devopvoid#360) and its fixed clang package are left out. - The data channels variant builds WebRTC without H.265 and without the extra targets, leaves out the audio codec factory bindings and addTransceiverOfType, and skips the new tests that need audio or video. - dav1d is built against the sysroot on native Linux builds as well, as FFmpeg is. CI installs Meson for the full variant only, checks out the dav1d submodule, and adds its commit to the FFmpeg cache key. The fork's Windows SDK step stays, without upstream's second one. - The release workflow records the docs' version in the tagged commit, as upstream's now does. The docs site still builds from main, since this fork publishes none. - The Maven files stay deleted: Jetty is bumped in the version catalog, and the docs lockfile takes upstream's bumps on top of the fork's newer VitePress. - The media module's README builds with Gradle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WebRTC was built without H.265 (
rtc_use_h265followsproprietary_codecs, which is off), so a call could not carry H.265 even with an encoder and decoder for it: there was no H.265 RTP packetization, no depacketizer (WebRTC creates none and drops the stream) and no H.265 negotiation. This builds WebRTC with it. It is the groundwork for hardware H.265 in calls on Windows, macOS and Linux, which the hardware codec factories add next.rtc_use_h265=truein the GN args, andRTC_ENABLE_H265for the JNI code, so that it is compiled against the same declarations. None of the headers the JNI code includes changes a struct layout with it.webrtc.lib/libwebrtc.awas taken as it was, so a change to the args never reached a machine that had built WebRTC once. The record is written only when gn and ninja succeed. CI's WebRTC cache key already hashes thisCMakeLists.txt, so CI rebuilds on its own.VideoEncoderWrapper(Java encoders) parses the QP of H.265 frames and uses the H.264 quality-scaling thresholds for H.265, as WebRTC's own Android wrapper does (bugs.webrtc.org/13485).Testing
rtc_use_h265touches is recompiled; about 5 minutes here). The new library has the H.265 packetizer, depacketizer and bitstream parser, and the next configure reuses it.VideoCodecFactoryTests.h265CallRoundTripsis new: a call between two local peer connections negotiates H.265 through a Java encoder and decoder, which wrap the test payload in H.265 NAL units (VPS, SPS, PPS and an IDR slice). Every frame received is one that was sent. Without H.265 in WebRTC the receiver has no depacketizer for the stream and nothing arrives.webrtcandwebrtc-java-mediapass against the rebuilt library.Not verified
The rebuild ran on Windows x64 only; CI rebuilds WebRTC for the other six platforms. No real H.265 encoder or decoder is involved yet: the test checks negotiation, packetization and depacketization with a synthetic bitstream.