[PR #239] [CLOSED] Add AAC and H265 support to WHIP streaming #242

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

📋 Pull Request Information

Original PR: https://github.com/eerimoq/moblin/pull/239
Author: @Copilot
Created: 2/14/2026
Status: Closed

Base: mainHead: copilot/add-aac-h265-support


📝 Commits (3)

  • 9136b14 Initial plan
  • 47fa81d Add AAC and H265 codec support to WHIP streaming
  • 73959ec Use explicit codec cases instead of default in packetizer setup

📊 Changes

5 files changed (+155 additions, -32 deletions)

View changed files

📝 Moblin/Media/HaishinKit/Whip/WhipStream.swift (+141 -27)
📝 Moblin/Various/Media.swift (+8 -2)
📝 Moblin/Various/Model/ModelStream.swift (+4 -1)
📝 Moblin/View/Settings/Streams/Stream/Audio/StreamAudioSettingsView.swift (+1 -1)
📝 Moblin/View/Settings/Streams/Stream/Video/StreamVideoSettingsView.swift (+1 -1)

📄 Description

WHIP streaming was hardcoded to H.264/Opus. This wires up the existing user-facing codec settings (stream.codec, stream.audioCodec) to the WHIP transport layer, leveraging libdatachannel v0.24.0's rtcSetH265Packetizer and rtcSetAACPacketizer.

WhipStream.swift

  • Added H265NalUnits class handling VPS/SPS/PPS parameter sets (H.265 requires VPS in addition to H.264's SPS/PPS)
  • RtcTrackConfig.makeAudio/makeVideo now accept codec parameters and configure the correct RTC_CODEC_* and payload types
  • Packetizer selection dispatches to the correct rtcSet{H264,H265,Opus,AAC}Packetizer based on codec
  • handleVideoEncoderOutputFormat parses either MpegTsVideoConfigAvc or MpegTsVideoConfigHevc
  • handleVideoEncoderOutputSampleBuffer routes through the matching NAL unit handler

Plumbing

  • Media.whipStartStream() and WhipStream.start() accept videoCodec/audioCodec parameters
  • ModelStream.startNetStreamWhip() passes stream.codec and stream.audioCodec through

UI

  • Removed WHIP from codec limitation warnings since both codecs are now supported

Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


🔄 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/239 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 2/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `copilot/add-aac-h265-support` --- ### 📝 Commits (3) - [`9136b14`](https://github.com/eerimoq/moblin/commit/9136b1491d633d7e3f69d6652e68bcb421c29a06) Initial plan - [`47fa81d`](https://github.com/eerimoq/moblin/commit/47fa81d2841b49ef1f3164f51b12ebddf08a8204) Add AAC and H265 codec support to WHIP streaming - [`73959ec`](https://github.com/eerimoq/moblin/commit/73959ec7a83b444b09ec939b649e7f15ba758aa3) Use explicit codec cases instead of default in packetizer setup ### 📊 Changes **5 files changed** (+155 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `Moblin/Media/HaishinKit/Whip/WhipStream.swift` (+141 -27) 📝 `Moblin/Various/Media.swift` (+8 -2) 📝 `Moblin/Various/Model/ModelStream.swift` (+4 -1) 📝 `Moblin/View/Settings/Streams/Stream/Audio/StreamAudioSettingsView.swift` (+1 -1) 📝 `Moblin/View/Settings/Streams/Stream/Video/StreamVideoSettingsView.swift` (+1 -1) </details> ### 📄 Description WHIP streaming was hardcoded to H.264/Opus. This wires up the existing user-facing codec settings (`stream.codec`, `stream.audioCodec`) to the WHIP transport layer, leveraging libdatachannel v0.24.0's `rtcSetH265Packetizer` and `rtcSetAACPacketizer`. ### WhipStream.swift - Added `H265NalUnits` class handling VPS/SPS/PPS parameter sets (H.265 requires VPS in addition to H.264's SPS/PPS) - `RtcTrackConfig.makeAudio`/`makeVideo` now accept codec parameters and configure the correct `RTC_CODEC_*` and payload types - Packetizer selection dispatches to the correct `rtcSet{H264,H265,Opus,AAC}Packetizer` based on codec - `handleVideoEncoderOutputFormat` parses either `MpegTsVideoConfigAvc` or `MpegTsVideoConfigHevc` - `handleVideoEncoderOutputSampleBuffer` routes through the matching NAL unit handler ### Plumbing - `Media.whipStartStream()` and `WhipStream.start()` accept `videoCodec`/`audioCodec` parameters - `ModelStream.startNetStreamWhip()` passes `stream.codec` and `stream.audioCodec` through ### UI - Removed WHIP from codec limitation warnings since both codecs are now supported <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/eerimoq/moblin/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --- <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:53 +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#242
No description provided.