Skip to main content

TiRTC Python SDK

tirtc 提供 headless RTC 接收与 Ti Cloud Storage 查询、回放和导出。它直接消费 Runtime public C,不在 Python 中重新实现连接、媒体处理、录像或云端协议。

当前支持普通 CPython 3.11 及之后的稳定版本,以及 macOS 11.5+ arm64、glibc Linux x86_64。binary wheel 已包含 Native 动态库和第三方许可证;安装和运行都不需要另外下载 Runtime,也不需要设置 DYLD_LIBRARY_PATHLD_LIBRARY_PATH

安装

公开发布后使用精确版本安装:

python -m pip install --only-binary=:all: tirtc==<version>

RTC 主链路从初始化开始,按 Output、Connection 的反向顺序释放:

from pathlib import Path
import tirtc

tirtc.initialize(APP_ID, Path("/absolute/cache"))
try:
    with tirtc.Connection(on_state_changed=on_state) as connection:
        with tirtc.VideoOutput(on_frame=on_frame, on_error=on_error) as video:
            video.attach(connection, stream_id=0)
            connection.connect(DEVICE_ID, TOKEN)
            connection.subscribe_video(0)
            wait_for_frame()
            connection.unsubscribe_video(0)
            video.detach()
            connection.disconnect()
finally:
    tirtc.shutdown()

持续事件与媒体帧通过 callback 交付。Frame 是不可变 value,数据为 read-only memoryview;需要独立的可变或长期缓冲时显式调用 bytes(frame.data)。所有 Native 资源都提供明确的 close()stop()wait()delete(),正常释放不依赖垃圾回收。

完整 RTC 程序见 example/client,Ti Cloud Storage 程序见 example/storage。公开声明分别见仓库的 Python RTC 与 Ti Cloud Storage API Reference。

Release files for tirtc 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for tirtc 2.4.0
File Interpreter ABI Platform
tirtc-2.4.0-cp311-abi3-manylinux_2_35_x86_64.whl CPython 3.11 abi3 Linux glibc 2.35+ x86-64 Details
tirtc-2.4.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details

Total release size: 96.4 MB

Release files / tirtc-2.4.0-cp311-abi3-manylinux_2_35_x86_64.whl

Download URL tirtc-2.4.0-cp311-abi3-manylinux_2_35_x86_64.whl
Size 69.0 MB
Tags CPython 3.11 Linux glibc 2.35+ x86-64 abi3
SHA-256 checksum
How to use checksums
345a9876efff35bc7bc1a3fc9c3996a2cbd06352bb281cd892557f7dbc8aaada
BLAKE2b-256 checksum
How to use checksums
5ec8ca4ac3475e672e782db38d4a646f49c1b92bf60c7267717a32dc51010b73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / tirtc-2.4.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL tirtc-2.4.0-cp311-abi3-macosx_11_0_arm64.whl
Size 27.4 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
818c2b6b559d79558f08e4ffd69272196363e72ab31d084bd012784395bd5993
BLAKE2b-256 checksum
How to use checksums
21b63aa0e2aedc44815edb9c2bfbc2c74ebaddfaa53da914e87c4218ce17cb1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release history Release notifications | RSS feed

2.5.0

2 release files

2.4.2

2 release files

2.4.1

2 release files

This release

2.4.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page