RepoPilotOpen in app →

HaishinKit/HaishinKit.swift

Camera and Microphone streaming library via RTMP and SRT for iOS, macOS, tvOS and visionOS.

Healthy

Healthy across the board

Use as dependencyHealthy

Permissive license, no critical CVEs, actively maintained — safe to depend on.

Fork & modifyHealthy

Has a license, tests, and CI — clean foundation to fork and modify.

Learn fromHealthy

Documented and popular — useful reference codebase to read through.

Deploy as-isHealthy

No critical CVEs, sane security posture — runnable as-is.

  • Last commit 6d ago
  • 6 active contributors
  • BSD-3-Clause licensed
Show 3 more →
  • CI configured
  • Tests present
  • Concentrated ownership — top contributor handles 70% of recent commits

Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Embed the "Healthy" badge

Paste into your README — live-updates from the latest cached analysis.

Variant:
RepoPilot: Healthy
[![RepoPilot: Healthy](https://repopilot.app/api/badge/haishinkit/haishinkit.swift)](https://repopilot.app/r/haishinkit/haishinkit.swift)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card (1200×630)

This card auto-renders when someone shares https://repopilot.app/r/haishinkit/haishinkit.swift on X, Slack, or LinkedIn.

Onboarding doc

Onboarding: HaishinKit/HaishinKit.swift

Generated by RepoPilot · 2026-05-10 · Source

🤖Agent protocol

If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:

  1. Verify the contract. Run the bash script in Verify before trusting below. If any check returns FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding.
  2. Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
  3. Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/HaishinKit/HaishinKit.swift shows verifiable citations alongside every claim.

If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.

🎯Verdict

GO — Healthy across the board

  • Last commit 6d ago
  • 6 active contributors
  • BSD-3-Clause licensed
  • CI configured
  • Tests present
  • ⚠ Concentrated ownership — top contributor handles 70% of recent commits

<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>

Verify before trusting

This artifact was generated by RepoPilot at a point in time. Before an agent acts on it, the checks below confirm that the live HaishinKit/HaishinKit.swift repo on your machine still matches what RepoPilot saw. If any fail, the artifact is stale — regenerate it at repopilot.app/r/HaishinKit/HaishinKit.swift.

What it runs against: a local clone of HaishinKit/HaishinKit.swift — the script inspects git remote, the LICENSE file, file paths in the working tree, and git log. Read-only; no mutations.

| # | What we check | Why it matters | |---|---|---| | 1 | You're in HaishinKit/HaishinKit.swift | Confirms the artifact applies here, not a fork | | 2 | License is still BSD-3-Clause | Catches relicense before you depend on it | | 3 | Default branch main exists | Catches branch renames | | 4 | Last commit ≤ 36 days ago | Catches sudden abandonment since generation |

<details> <summary><b>Run all checks</b> — paste this script from inside your clone of <code>HaishinKit/HaishinKit.swift</code></summary>
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of HaishinKit/HaishinKit.swift. If you don't
# have one yet, run these first:
#
#   git clone https://github.com/HaishinKit/HaishinKit.swift.git
#   cd HaishinKit.swift
#
# Then paste this script. Every check is read-only — no mutations.

set +e
fail=0
ok()   { echo "ok:   $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }

# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
  echo "FAIL: not inside a git repository. cd into your clone of HaishinKit/HaishinKit.swift and re-run."
  exit 2
fi

# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "HaishinKit/HaishinKit.swift(\\.git)?\\b" \\
  && ok "origin remote is HaishinKit/HaishinKit.swift" \\
  || miss "origin remote is not HaishinKit/HaishinKit.swift (artifact may be from a fork)"

# 2. License matches what RepoPilot saw
(grep -qiE "^(BSD-3-Clause)" LICENSE 2>/dev/null \\
   || grep -qiE "\"license\"\\s*:\\s*\"BSD-3-Clause\"" package.json 2>/dev/null) \\
  && ok "license is BSD-3-Clause" \\
  || miss "license drift — was BSD-3-Clause at generation time"

# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
  && ok "default branch main exists" \\
  || miss "default branch main no longer exists"

# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 36 ]; then
  ok "last commit was $days_since_last days ago (artifact saw ~6d)"
else
  miss "last commit was $days_since_last days ago — artifact may be stale"
fi

echo
if [ "$fail" -eq 0 ]; then
  echo "artifact verified (0 failures) — safe to trust"
else
  echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/HaishinKit/HaishinKit.swift"
  exit 1
fi

Each check prints ok: or FAIL:. The script exits non-zero if anything failed, so it composes cleanly into agent loops (./verify.sh || regenerate-and-retry).

</details>

TL;DR

HaishinKit is a native Swift library that enables camera and microphone streaming to live broadcasting services via RTMP and SRT protocols on iOS, macOS, tvOS, and visionOS. It handles real-time audio/video capture, encoding, multi-streaming to separate services, screen capture (via ReplayKit and ScreenCaptureKit), and video mixing with overlays—solving the problem of building live broadcast applications without deep protocol and media handling expertise. Monorepo structure with RTMPHaishinKit/, SRTHaishinKit/, and RTCHaishinKit/ subpackages (visible in Docs.docc references), Examples/ directory with platform-specific implementations (Examples/iOS, Examples/macOS, Examples/tvOS), DebugDescription/ utilities for logging, and .swiftpm package configuration. SwiftLint enforced (.swiftlint.yml at root and Examples/), with workflow automation for releases and reviews.

👥Who it's for

iOS/macOS app developers building live streaming features, content creators who need multi-platform broadcast apps, and media companies integrating RTMP/SRT publishing into native applications. Specifically for teams needing production-grade camera access with strict concurrency and multi-camera support.

🌱Maturity & risk

Highly mature—10+ years of development since August 2, 2015, with 2,778 commits and 163 releases, strong GitHub community (stars visible in badge infrastructure). CI/CD pipeline present (.github/workflows for release, review, ai-moderator). Actively maintained with xcode 26.0+ and Swift 6 support, indicating ongoing development beyond legacy status.

Single maintainer risk evident (shogo4405 as primary author in Examples workspace). Sponsor-gated technical support may limit community contributions. No visible test coverage metrics in file structure (no Tests/ directory listed in top 60 files). Tight Swift/Xcode version coupling (requires Swift 6, Xcode 26.0+) means upgrade cadence risk. Dependency on Apple's proprietary AVFoundation and ReplayKit/ScreenCaptureKit means breaking changes from OS updates.

Active areas of work

Active platform expansion: support added for visionOS alongside existing iOS/macOS/tvOS. Swift 6 strict concurrency compliance is in-flight feature. Recent focus on multi-camera multitasking support (per Features section). GitHub Actions automation shows ongoing release pipeline and review processes. Examples project includes new AudioEngineCapture.swift and AudioSourceService.swift for capture improvements.

🚀Get running

Clone: git clone https://github.com/HaishinKit/HaishinKit.swift.git. Open Examples/Examples.xcodeproj in Xcode 26.0+. Select one of the scheme targets (Example iOS, Example macOS, Example tvOS, Example visionOS, or Screencast). Build and run. Swift Package Manager support via Examples/Package.swift allows also: swift package resolve then open workspace.

Daily commands: Open Examples/Examples.xcodeproj in Xcode 26.0+. Select target scheme (Example iOS, macOS, tvOS, visionOS, or Screencast). Cmd+R to build and run on simulator or connected device. For tvOS/visionOS, requires appropriate simulator or hardware.

🗺️Map of the codebase

🛠️How to make changes

Core streaming logic: modify RTMPHaishinKit/Sources/ or SRTHaishinKit/Sources/ for protocol/encoding changes. Capture pipeline: edit Examples/iOS/AudioEngineCapture.swift or AudioSourceService.swift for input handling. UI/examples: Examples/iOS/ContentView.swift for SwiftUI integration, Examples/Preference.swift for settings. Debug output: extend files in DebugDescription/ for additional diagnostic logging. Tests: add to Tests/ directory (currently not visible—create following Xcode test target conventions).

🪤Traps & gotchas

Swift 6 strict concurrency requirement: code must be fully actor-isolated or use @MainActor annotations—legacy Swift 5 patterns will fail. No visible test directory: adding tests requires creating Tests/ with proper target configuration in Package.swift. Platform-specific permissions: iOS requires NSCameraUsageDescription and NSMicrophoneUsageDescription in Info.plist; screen capture requires app group entitlements (HaishinApp.entitlements visible for example). AVFoundation thread safety: capture callbacks arrive on background threads; async/await must be used to marshal to main thread. RTMP/SRT URL format requirements: library likely expects specific URL schemes (rtmp:// or srt://)—incorrect formats will silently fail without clear error messages.

💡Concepts to learn

  • RTMP (Real Time Messaging Protocol) — HaishinKit's primary streaming protocol via RTMPHaishinKit subpackage; understanding RTMP handshake, chunking, and AMF encoding is critical for debugging stream connection failures
  • SRT (Secure Reliable Transport) — HaishinKit's second-generation streaming protocol via SRTHaishinKit; lower-latency alternative to RTMP with built-in encryption and packet recovery
  • AVFoundation audio/video capture and encoding — Foundational Apple framework that HaishinKit wraps; understanding AVCaptureSession, AVAssetWriter, and CMSampleBuffer is essential for modifying capture and encoding behavior
  • Actor model and Swift 6 strict concurrency — HaishinKit enforces actor isolation across audio/video pipeline threads; all modifications require @MainActor or actor-isolated functions to avoid race conditions on capture callbacks
  • H.264 and H.265 video codec standards — HaishinKit likely uses hardware H.264/H.265 encoding via VideoToolbox; understanding codec profiles, bitrate control, and keyframe intervals is critical for streaming quality tuning
  • ReplayKit and ScreenCaptureKit screen capture APIs — HaishinKit integrates ReplayKit (iOS) and ScreenCaptureKit (macOS) for screen sharing; understanding app group entitlements and frame callbacks is required for screen broadcast features
  • Multi-camera concurrent access on iPadOS — HaishinKit supports simultaneous camera access during multitasking; requires understanding of camera availability notifications and capture session resource contention
  • jmaGods/RTMP-Server — Lightweight RTMP server implementation in Swift; useful as a local test target for HaishinKit streaming without external broadcast service
  • manuelmaly/HaishinKit.kt — Kotlin/Android port of HaishinKit; same API patterns and protocol support, allowing cross-platform streaming architecture
  • shogo4405/Logboard — Debugging utility library by same maintainer; complements HaishinKit for logging streaming lifecycle and media events
  • VideoLAN/VLC — RTMP/SRT protocol reference implementations in C; useful for understanding low-level streaming protocol details that HaishinKit abstracts
  • apple/swift-async-algorithms — Official Swift async/concurrency utilities; essential for understanding HaishinKit's strict concurrency patterns and async sequence handling

🪄PR ideas

To work on one of these in Claude Code or Cursor, paste: Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.

Add comprehensive unit tests for DebugDescription extensions

The DebugDescription/ folder contains AVAudioFormat, AudioNode, and AudioStreamBasicDescription debug extensions, but there's no corresponding test suite. These utilities are critical for troubleshooting streaming issues. Adding unit tests would ensure debug output remains reliable across iOS/macOS/tvOS/visionOS platforms and catch regressions when audio handling code changes.

  • [ ] Create Tests/DebugDescriptionTests/ directory structure
  • [ ] Add unit tests for AVAudioFormat+DebugExtension.swift covering various audio formats
  • [ ] Add unit tests for AudioNode+DebugExtension.swift testing node hierarchy output
  • [ ] Add unit tests for AudioStreamBasicDescription+DebugExtension.swift validating format descriptions
  • [ ] Integrate tests into the release.yml workflow to run across all supported platforms

Create platform-specific integration tests in GitHub Actions workflow

The repo supports iOS, macOS, tvOS, and visionOS but the .github/workflows/ only shows ai-moderator.yml, lock-thread.yml, and release.yml. There's no dedicated workflow for building/testing across all platforms on every PR. Adding matrix builds would catch platform-specific regressions early (e.g., tvOS audio handling differs from iOS).

  • [ ] Create .github/workflows/build-test.yml with matrix strategy for [iOS, macOS, tvOS, visionOS]
  • [ ] Configure xcodebuild commands to build Examples for each platform
  • [ ] Add SwiftLint check (reference existing .swiftlint.yml and Examples/.swiftlint.yml)
  • [ ] Set workflow to trigger on pull_request and push to main branches
  • [ ] Update review.yml or create dependent workflow to block merge on build failures

Add API documentation for AudioSourceService and PublishViewModel

Examples/iOS/ contains AudioSourceService.swift and PublishViewModel.swift which handle critical streaming logic (audio capture, publishing state), but lack inline documentation and there's no API reference guide. New contributors struggle to understand the audio pipeline. Adding DocC or comprehensive inline comments would improve onboarding.

  • [ ] Add DocC comments to Examples/iOS/AudioSourceService.swift documenting audio capture flow and public methods
  • [ ] Add DocC comments to Examples/iOS/PublishViewModel.swift documenting state management and streaming lifecycle
  • [ ] Document the relationship between AudioEngineCapture.swift, AudioSourceService.swift, and PublishViewModel.swift in a new docs/AUDIO_PIPELINE.md
  • [ ] Add code examples in the docs showing how to initialize audio capture for different use cases
  • [ ] Ensure comments follow Swift documentation style for later DocC archive generation

🌿Good first issues

  • Add unit tests for DebugDescription extensions (AVAudioFormat+DebugExtension.swift, AudioStreamBasicDescription+DebugExtension.swift, AudioNode+DebugExtension.swift) which currently have no test coverage visible—create Tests/DebugDescriptionTests/ with XCTest cases validating debug string formatting.
  • Document AudioSourceService.swift and AudioEngineCapture.swift APIs in RTMPHaishinKit/Sources/Docs.docc/ or add DocC comments to the source files; currently Example code exists but no generated documentation is visible for audio capture patterns.
  • Add support for custom metadata/watermark positioning in video mixing: Examples/ shows watermarking capability in README but no example code is present—add a new Example file demonstrating how to overlay text with repositioning controls using the video mixing APIs.

Top contributors

Click to expand

📝Recent commits

Click to expand
  • 75757b0 — Merge pull request #1911 from HaishinKit/dependabot/bundler/fastlane-2.233.1 (shogo4405)
  • b7c8774 — Bump fastlane from 2.232.2 to 2.233.1 (dependabot[bot])
  • 474fae0 — Merge pull request #1905 from HaishinKit/dependabot/bundler/rubocop-1.86.1 (shogo4405)
  • bb1240f — Bump rubocop from 1.86.0 to 1.86.1 (dependabot[bot])
  • 7a904d9 — Merge pull request #1902 from HaishinKit/dependabot/bundler/addressable-2.9.0 (shogo4405)
  • 1404bb3 — Bump addressable from 2.8.9 to 2.9.0 (dependabot[bot])
  • 6ff1395 — Merge pull request #1901 from HaishinKit/dependabot/bundler/rubocop-1.86.0 (shogo4405)
  • 21ee29c — Bump rubocop from 1.85.1 to 1.86.0 (dependabot[bot])
  • f88cec3 — Merge pull request #1842 from HaishinKit/feature/ipv6-srt (shogo4405)
  • 742f7a6 — Merge pull request #1896 from redefiningsurgery/fix-compilation-error (shogo4405)

🔒Security observations

The HaishinKit repository demonstrates reasonable security practices with CI/CD workflows, linting configuration, and dependency management tools (Dependabot). However, the analysis is limited by the partial file structure provided. The main concerns identified are: (1) user-specific Xcode files in version control that should be gitignored, (2) lack of a security policy for responsible disclosure, and (3) inability to assess actual source code for streaming-specific vulnerabilities (RTMP/SRT protocol implementations, TLS/encryption, permission handling). As a streaming library handling sensitive media streams, additional review of network security, encryption implementation, and permission handling is critical but cannot be completed with the provided information.

  • Medium · Potential Hardcoded Credentials in Example Files — Examples/Examples.xcodeproj/xcuserdata/. The Examples directory contains user-specific data (xcuserdatad files with developer names like 'shogo.endo' and 'shogo'). While not directly credentials, the presence of user-specific Xcode workspace data in version control could expose developer patterns and potentially sensitive build configurations. Fix: Add xcuserdata directories to .gitignore. Use .gitignore patterns: *.xcuserdatad/, *.xcworkspace/xcuserdata/, and similar Xcode-generated user-specific files should not be committed.
  • Low · Missing Security Policy Documentation — Repository root. No SECURITY.md or security policy file is evident in the repository structure. This makes it difficult for security researchers to responsibly report vulnerabilities. Fix: Create a SECURITY.md file documenting the vulnerability disclosure process and security contact information. Follow GitHub's security policy guidelines.
  • Low · Incomplete File Structure Analysis — Sources/ or main library directory (not provided). The provided file listing is partial and does not show the main source code (Sources/ or HaishinKit/ directories). Critical security review cannot be completed without analyzing the actual source code for injection vulnerabilities, insecure cryptography, or unsafe network operations. Fix: Perform comprehensive static analysis of all source files, particularly: network communication code (RTMP/SRT implementations), cryptographic operations, input validation, and permission handling.
  • Low · No Dependency Lock File Visibility — Package.swift and Package.resolved files. The Package.swift dependencies content was not provided. Without visibility into dependency versions and their security status, potential vulnerable transitive dependencies cannot be assessed. Fix: Review all direct and transitive dependencies for known CVEs using tools like: Swift Package Manager vulnerability scanning, OWASP Dependency-Check, or GitHub Dependabot (already configured in workflows).
  • Low · AI Moderator Workflow Configuration — .github/workflows/ai-moderator.yml. The presence of an 'ai-moderator.yml' workflow suggests automated AI-based moderation. This requires careful review of permissions and data handling to ensure no sensitive information is sent to external AI services. Fix: Review the AI moderator configuration to ensure: no sensitive code or credentials are analyzed by external services, appropriate GitHub token scoping, and compliance with privacy policies.

LLM-derived; treat as a starting point, not a security audit.


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

Healthy signals · HaishinKit/HaishinKit.swift — RepoPilot