[PR #227] [CLOSED] Adds full WHIP and WHEP support to Moblin #229

Closed
opened 2026-03-02 04:00:49 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/eerimoq/moblin/pull/227
Author: @anishmenon
Created: 2/9/2026
Status: Closed

Base: mainHead: feature/whip-whep


📝 Commits (4)

  • fa70cdd vendor: add HaishinKit.swift as local package
  • be0010c feat: add WHIP/WHEP support for streaming, ingest, and playback
  • 0b83263 PRODUCT_BUNDLE_IDENTIFIER reverted
  • 488961d Fix compilation errors: add missing types and resolve broken references

📊 Changes

443 files changed (+36175 additions, -111 deletions)

View changed files

📝 Common/Localizable.xcstrings (+76 -1)
📝 Common/Various/CommonUtils.swift (+9 -0)
📝 Common/Various/Validate.swift (+8 -0)
📝 Moblin Screen Recording/Moblin Screen Recording.entitlements (+1 -1)
📝 Moblin.xcodeproj/project.pbxproj (+44 -10)
📝 Moblin.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (+10 -1)
📝 Moblin/Info.plist (+28 -32)
📝 Moblin/Media/HaishinKit/Codec/Video/VideoDecoder.swift (+20 -0)
Moblin/Media/HaishinKit/WhipStream.swift (+172 -0)
Moblin/Media/WhepClient/WhepClient.swift (+198 -0)
Moblin/Media/WhipServer/WhipServer.swift (+593 -0)
📝 Moblin/Moblin.entitlements (+21 -21)
📝 Moblin/MoblinApp.swift (+5 -0)
📝 Moblin/Various/Media.swift (+33 -0)
📝 Moblin/Various/Model/Model.swift (+5 -0)
📝 Moblin/Various/Model/ModelCamera.swift (+22 -0)
📝 Moblin/Various/Model/ModelScene.swift (+37 -16)
📝 Moblin/Various/Model/ModelStream.swift (+50 -0)
📝 Moblin/Various/Model/ModelStreamWizard.swift (+9 -0)
Moblin/Various/Model/ModelWhepClient.swift (+89 -0)

...and 80 more files

📄 Description

Summary

Adds full WHIP and WHEP support to Moblin, enabling ultra-low-latency WebRTC streaming in all three directions:

  • WHIP Publishing (Stream out): Stream from Moblin to any WHIP-compatible endpoint (e.g., Cloudflare, Dolby.io, self-hosted servers) — just like RTMP/SRT but with sub-second latency. Available as a stream protocol option under Settings → Streams.
  • WHIP Server (Ingest in): Run a local WHIP server so external apps like OBS or FFmpeg can publish streams into Moblin over the local network. Ingested streams appear as selectable camera sources in scenes. Available under Settings → Ingests.
  • WHEP Client (Playback): Subscribe to remote WebRTC streams via WHEP and use them as camera sources within Moblin. Available under Settings → Ingests.

Motivation

Addresses community feature requests for ultra-low-latency streaming using WebRTC. WHIP/WHEP are the standard HTTP-based signaling protocols for WebRTC, supported by OBS, FFmpeg 8+, Cloudflare, and many other platforms.

Changes

Commit 1: Vendor HaishinKit.swift — Adds HaishinKit.swift (with RTCHaishinKit) as a local Swift package for WebRTC support. Includes patches for H.264 STAP-A decoding, recvonly track lifecycle, and a compressed video callback hook.

Commit 2: WHIP/WHEP feature (35 files, ~2300 lines) — The actual feature implementation:

  • WHIP server with full ICE negotiation, trickle ICE (PATCH), and session teardown (DELETE)
  • WHEP client for subscribing to external WebRTC sources
  • WHIP publishing client using RTCHaishinKit's session builder
  • RTMP-style video decode pipeline (PTS retiming before decode) for smooth ingest playback
  • VideoDecoder session auto-recovery on persistent decode errors
  • Settings UI for WHIP server streams, WHEP client streams, and WHIP publishing
  • HttpServer extended with routing, response headers, and method dispatch
  • WHIP/WHEP streams as selectable camera sources in scene and widget configuration
  • Configurable buffer latency with 500ms cap for WebRTC ingest

Test plan

  • Publish from Moblin via WHIP to a WHIP-compatible server
  • Stream from OBS via WHIP to Moblin's WHIP server and verify video/audio in a scene
  • Subscribe to a remote WebRTC source via WHEP
  • Verify trickle ICE with PATCH
  • Verify session teardown (DELETE) and reconnection
  • Verify WHIP/WHEP camera sources in scene configuration

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/eerimoq/moblin/pull/227 **Author:** [@anishmenon](https://github.com/anishmenon) **Created:** 2/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/whip-whep` --- ### 📝 Commits (4) - [`fa70cdd`](https://github.com/eerimoq/moblin/commit/fa70cdd161027424d779461268d8c3fb2f05b51c) vendor: add HaishinKit.swift as local package - [`be0010c`](https://github.com/eerimoq/moblin/commit/be0010c426ce070bd575983e82c0c2c348bf7d80) feat: add WHIP/WHEP support for streaming, ingest, and playback - [`0b83263`](https://github.com/eerimoq/moblin/commit/0b83263d7489400d03de083930d162da70ed2c7b) PRODUCT_BUNDLE_IDENTIFIER reverted - [`488961d`](https://github.com/eerimoq/moblin/commit/488961d19c29e76332e615319f8a1b61b282814e) Fix compilation errors: add missing types and resolve broken references ### 📊 Changes **443 files changed** (+36175 additions, -111 deletions) <details> <summary>View changed files</summary> 📝 `Common/Localizable.xcstrings` (+76 -1) 📝 `Common/Various/CommonUtils.swift` (+9 -0) 📝 `Common/Various/Validate.swift` (+8 -0) 📝 `Moblin Screen Recording/Moblin Screen Recording.entitlements` (+1 -1) 📝 `Moblin.xcodeproj/project.pbxproj` (+44 -10) 📝 `Moblin.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved` (+10 -1) 📝 `Moblin/Info.plist` (+28 -32) 📝 `Moblin/Media/HaishinKit/Codec/Video/VideoDecoder.swift` (+20 -0) ➕ `Moblin/Media/HaishinKit/WhipStream.swift` (+172 -0) ➕ `Moblin/Media/WhepClient/WhepClient.swift` (+198 -0) ➕ `Moblin/Media/WhipServer/WhipServer.swift` (+593 -0) 📝 `Moblin/Moblin.entitlements` (+21 -21) 📝 `Moblin/MoblinApp.swift` (+5 -0) 📝 `Moblin/Various/Media.swift` (+33 -0) 📝 `Moblin/Various/Model/Model.swift` (+5 -0) 📝 `Moblin/Various/Model/ModelCamera.swift` (+22 -0) 📝 `Moblin/Various/Model/ModelScene.swift` (+37 -16) 📝 `Moblin/Various/Model/ModelStream.swift` (+50 -0) 📝 `Moblin/Various/Model/ModelStreamWizard.swift` (+9 -0) ➕ `Moblin/Various/Model/ModelWhepClient.swift` (+89 -0) _...and 80 more files_ </details> ### 📄 Description ## Summary Adds full WHIP and WHEP support to Moblin, enabling ultra-low-latency WebRTC streaming in all three directions: - **WHIP Publishing (Stream out):** Stream from Moblin to any WHIP-compatible endpoint (e.g., Cloudflare, Dolby.io, self-hosted servers) — just like RTMP/SRT but with sub-second latency. Available as a stream protocol option under **Settings → Streams**. - **WHIP Server (Ingest in):** Run a local WHIP server so external apps like OBS or FFmpeg can publish streams into Moblin over the local network. Ingested streams appear as selectable camera sources in scenes. Available under **Settings → Ingests**. - **WHEP Client (Playback):** Subscribe to remote WebRTC streams via WHEP and use them as camera sources within Moblin. Available under **Settings → Ingests**. ## Motivation Addresses community feature requests for ultra-low-latency streaming using WebRTC. WHIP/WHEP are the standard HTTP-based signaling protocols for WebRTC, supported by OBS, FFmpeg 8+, Cloudflare, and many other platforms. ## Changes **Commit 1: Vendor HaishinKit.swift** — Adds HaishinKit.swift (with RTCHaishinKit) as a local Swift package for WebRTC support. Includes patches for H.264 STAP-A decoding, recvonly track lifecycle, and a compressed video callback hook. **Commit 2: WHIP/WHEP feature** (35 files, ~2300 lines) — The actual feature implementation: - WHIP server with full ICE negotiation, trickle ICE (PATCH), and session teardown (DELETE) - WHEP client for subscribing to external WebRTC sources - WHIP publishing client using RTCHaishinKit's session builder - RTMP-style video decode pipeline (PTS retiming before decode) for smooth ingest playback - VideoDecoder session auto-recovery on persistent decode errors - Settings UI for WHIP server streams, WHEP client streams, and WHIP publishing - HttpServer extended with routing, response headers, and method dispatch - WHIP/WHEP streams as selectable camera sources in scene and widget configuration - Configurable buffer latency with 500ms cap for WebRTC ingest ## Test plan - [ ] Publish from Moblin via WHIP to a WHIP-compatible server - [ ] Stream from OBS via WHIP to Moblin's WHIP server and verify video/audio in a scene - [ ] Subscribe to a remote WebRTC source via WHEP - [ ] Verify trickle ICE with PATCH - [ ] Verify session teardown (DELETE) and reconnection - [ ] Verify WHIP/WHEP camera sources in scene configuration --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:00:49 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/moblin#229
No description provided.