Skip to main content

WebRTC SFU Sora Python SDK

Project description

Sora Python SDK

PyPI image License Actions status

Sora Python SDK は WebRTC SFU Sora の Python クライアントアプリケーションを開発するためのライブラリです。Sora C++ SDK をベースにしています。

About Shiguredo's open source software

We will not respond to PRs or issues that have not been discussed on Discord. Also, Discord is only available in Japanese.

Please read https://github.com/shiguredo/oss/blob/master/README.en.md before use.

時雨堂のオープンソースソフトウェアについて

利用前に https://github.com/shiguredo/oss をお読みください。

Sora Python SDK について

様々なプラットフォームに対応しすぐに使い始められる WebRTC SFU Sora 向けの Python SDK です。

音声や映像デバイスの処理を SDK から独立させているため、様々なライブラリを利用する事ができます。

特徴

  • Sora C++ SDK ベース
  • WebRTC 部分の機能は libwebrtc を採用
  • Windows / macOS / Linux (Ubuntu / Raspberry Pi OS) プラットフォームに対応
  • WebRTC 統計情報 の取得が可能
  • WebRTC Encoded Transform に対応
  • 回線が不安定になった際、解像度とフレームレートどちらを維持するかの設定をする DegradationPreference に対応
    • MAINTAIN_FRAMERATE / MAINTAIN_RESOLUTION / BALANCED が指定できる
  • 発話区間の検出が可能な VAD (Voice Activity Detection) に対応
  • Intel / Apple / NVIDIA / Raspberry Pi のハードウェアデコーダー/エンコーダーに対応
    • Apple Video Toolbox (H.264 / H.265)
      • macOS arm64 で利用できる
    • Intel VPL (AV1 / H.264 / H.265)
      • Ubuntu x86_64 / Windows x86_64 で利用できる
    • AMD AMF (VP9 /AV1 / H.264 / H.265)
      • Ubuntu x86_64 / Windows x86_64 で利用できる
      • AV1 エンコードは Windows x86_64 でのみ利用できる
      • VP9 はデコードのみ利用できる
    • NVIDIA Video Codec (VP8 / VP9 / AV1 / H.264 / H.265)
      • Ubuntu x86_64 / Windows x86_64 で利用できる
      • VP8 と VP9 はデコードのみ利用できる
    • NVIDIA Jetson JetPack SDK (AV1 / H.264 / H.265)
    • Raspberry Pi (H.264)
      • Raspberry Pi 4 / Raspberry Pi 3 / Raspberry Pi 2 Model B v1.2 / Raspberry Pi Zero 2 W で利用できる
      • V4L2-M2M API を利用している
    • 各プラットフォームで利用可能な HWA への対応
  • OpenH264 を利用した H.264 のソフトウェアエンコーダー/デコーダーに対応
    • Ubuntu x86_64 / Ubuntu arm64 / Windows x86_64 / macOS arm64 で利用できる
  • 音声デバイス処理に sounddevice などが利用できる
  • 映像デバイス処理に opencv-python などが利用できる
  • 音声認識などの入力に受信した音声を利用できる
  • 物体検出などの入力に受信した映像を利用できる
  • uv add sora_sdkpip install sora_sdk でインストールできる
    • Raspberry Pi 向けのパッケージも uv add sora_sdk_rpi でインストールできる
  • Raspberry Pi 向けに libcamera 用の create_libcamera_source を提供
  • NVIDIA Jetson JetPack SDK に対応

利用イメージ

  • データチャンネルを利用して Python において映像、音声を解析した結果を Sora 経由で配信する
  • Text to Speech の音声を Sora 経由で配信する
  • 映像入力に対して Pillow などで加工した映像を Sora を経由で配信する
  • A チャンネルの参加者からの映像と音声を B チャンネルに対して加工した上で Sora 経由で配信する

ドキュメント

Sora Python SDK

サンプル集

shiguredo/sora-python-sdk-examples

sora_sdk パッケージの追加

uv の利用を推奨します。

uv add sora_sdk

Raspberry Pi OS 向けパッケージ

uv add sora_sdk_rpi

NVIDIA Jetson 向けパッケージ

PyPI 経由ではインストールできません。 パッケージバイナリを配布しておりますので、そちらをご利用ください。

https://github.com/shiguredo/sora-python-sdk/releases/tag/2024.3.0-jetson-jetpack-6.0.0.0

システム条件

  • WebRTC SFU Sora 2024.2.0 以降
  • Python 3.11 以上

Python サポートポリシー

直近の 3 バージョンの Python をサポートします。

対応プラットフォーム

  • Ubuntu 24.04 LTS x86_64
  • Ubuntu 24.04 LTS arm64
  • Ubuntu 22.04 LTS x86_64
  • Ubuntu 22.04 LTS arm64
  • macOS Sequoia 15 arm64
  • macOS Ventura 14 arm64
  • Windows 11 x86_64
  • Windows Server 2025 x86_64
  • Raspberry Pi OS armv8

Raspberry Pi OS 向け

  • Raspberry Pi OS bookworm (64bit)
    • Raspberry Pi 5
    • Raspberry Pi 4
    • Raspberry Pi 3
    • Raspberry Pi 2 Model B v1.2
    • Raspberry Pi Zero 2 W

[!CAUTION]

  • Raspberry Pi 5 は H.264 ハードウェアエンコーダーが搭載されていません
  • Raspberry Pi 5 の H.265 ハードウェアデコーダーに対応していません

NVIDIA Jetson 向け

  • Ubuntu 22.04 LTS arm64 (NVIDIA Jetson JetPack SDK 6)
    • PyPI からではなくパッケージファイルを利用してください

macOS の対応バージョン

直近の 2 バージョンをサポートします。

Ubuntu の対応バージョン

直近の LTS 2 バージョンをサポートします。

優先実装

優先実装とは Sora のライセンスを契約頂いているお客様向けに Sora Python SDK の実装予定機能を有償にて前倒しで実装することです。

詳細は Discord やメールなどでお気軽にお問い合わせください

優先実装が可能な機能一覧

  • Windows 11 arm64
  • Ubuntu 22.04 arm64 (NVIDIA Jetson JetPack SDK 6.1)
  • Ubuntu 20.04 arm64 (NVIDIA Jetson JetPack SDK 5)

サポートについて

Discord

  • サポートしません
  • アドバイスします
  • フィードバック歓迎します

最新の状況などは Discord で共有しています。質問や相談も Discord でのみ受け付けています。

https://discord.gg/shiguredo

バグ報告

Discord へお願いします。

ライセンス

Apache License 2.0

Copyright 2023-2025, tnoho (Original Author)
Copyright 2023-2025, Wandbox LLC (Original Author)
Copyright 2023-2025, Shiguredo Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

OpenH264

https://www.openh264.org/BINARY_LICENSE.txt

"OpenH264 Video Codec provided by Cisco Systems, Inc."

NVDIA Video Codec SDK

https://docs.nvidia.com/video-technologies/video-codec-sdk/12.2/license/index.html

“This software contains source code provided by NVIDIA Corporation.”

H.264 (AVC) と H.265 (HEVC) のライセンスについて

時雨堂が提供する libwebrtc のビルド済みバイナリには H.264 と H.265 のコーデックは含まれていません

H.264

H.264 対応は Via LA Licensing (旧 MPEG-LA) に連絡を取り、ロイヤリティの対象にならないことを確認しています。

時雨堂がエンドユーザーの PC /デバイスに既に存在する AVC / H.264 エンコーダー/デコーダーに依存する製品を提供する場合は、 ソフトウェア製品は AVC ライセンスの対象外となり、ロイヤリティの対象にもなりません。

H.265

H.265 対応は以下の二つの団体に連絡を取り、H.265 ハードウェアアクセラレーターのみを利用し、 H.265 が利用可能なバイナリを配布する事は、ライセンスが不要であることを確認しています。

また、H.265 のハードウェアアクセラレーターのみを利用した H.265 対応の SDK を OSS で公開し、 ビルド済みバイナリを配布する事は、ライセンスが不要であることも確認しています。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sora_sdk_rpi-2025.5.0.dev6-cp314-cp314-manylinux_2_35_aarch64.whl (7.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.35+ ARM64

sora_sdk_rpi-2025.5.0.dev6-cp313-cp313-manylinux_2_35_aarch64.whl (7.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ ARM64

sora_sdk_rpi-2025.5.0.dev6-cp312-cp312-manylinux_2_35_aarch64.whl (7.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ ARM64

sora_sdk_rpi-2025.5.0.dev6-cp311-cp311-manylinux_2_35_aarch64.whl (7.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ ARM64

File details

Details for the file sora_sdk_rpi-2025.5.0.dev6-cp314-cp314-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for sora_sdk_rpi-2025.5.0.dev6-cp314-cp314-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 08d0e49944282af0ae885cdb07597cd4610a0b9ed29a4e9f12453861a67b12ed
MD5 f7a2c7e3233e51f0dde0ef48cee54ccc
BLAKE2b-256 7e0380e1530fb12aaaa54d2b869d133d2c8e9d83290537c622822423d6179377

See more details on using hashes here.

Provenance

The following attestation bundles were made for sora_sdk_rpi-2025.5.0.dev6-cp314-cp314-manylinux_2_35_aarch64.whl:

Publisher: build.yml on shiguredo/sora-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sora_sdk_rpi-2025.5.0.dev6-cp313-cp313-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for sora_sdk_rpi-2025.5.0.dev6-cp313-cp313-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 f4a77ecd6f8075d4172c890372032b2bf4bf7fc27707654381ce134f03ae551c
MD5 a596c45a941011fa6bfb39bd19407db1
BLAKE2b-256 0faf389c2c60be8520f5596d9c0ece02619ee81e93525fd3bf7d7b7cc87e5731

See more details on using hashes here.

Provenance

The following attestation bundles were made for sora_sdk_rpi-2025.5.0.dev6-cp313-cp313-manylinux_2_35_aarch64.whl:

Publisher: build.yml on shiguredo/sora-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sora_sdk_rpi-2025.5.0.dev6-cp312-cp312-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for sora_sdk_rpi-2025.5.0.dev6-cp312-cp312-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 9796f0219a525cc6a181307cd5ee85436c53a635d81f25d0ea2e5f1946a918e1
MD5 3cd0ba2b5bbec90e90ad2f26e0f47b88
BLAKE2b-256 8a2660bc80f0d681778344093a8f0195b72938496bdceeaefc0693b5cc5cd8bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for sora_sdk_rpi-2025.5.0.dev6-cp312-cp312-manylinux_2_35_aarch64.whl:

Publisher: build.yml on shiguredo/sora-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sora_sdk_rpi-2025.5.0.dev6-cp311-cp311-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for sora_sdk_rpi-2025.5.0.dev6-cp311-cp311-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 e593583dfcb77a86787790b9077cfee62cf3e9d541b3554927841d90e9585ad5
MD5 e6705c9cba52fcaac63f2fefc9cbc0af
BLAKE2b-256 27cfab02689d9daaba543dba3d054cae53b768b35d3beca833abda02feef5edf

See more details on using hashes here.

Provenance

The following attestation bundles were made for sora_sdk_rpi-2025.5.0.dev6-cp311-cp311-manylinux_2_35_aarch64.whl:

Publisher: build.yml on shiguredo/sora-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page