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_PATH 或 LD_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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tirtc-2.4.1-cp311-abi3-manylinux_2_35_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.35+ x86-64 | Details |
| tirtc-2.4.1-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.1-cp311-abi3-manylinux_2_35_x86_64.whl
| Download URL | tirtc-2.4.1-cp311-abi3-manylinux_2_35_x86_64.whl |
|---|---|
| Size | 69.1 MB |
| Tags | CPython 3.11 Linux glibc 2.35+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
bab68a7ac4178b4b52b351ae1701d8dbb3824baae67898feea5f8d289d86910d
|
|
BLAKE2b-256 checksum How to use checksums |
ca398d7ade5d8fdad2f62a1c5f404066b4b1832bf96bf2652eef82d52cd8d374
|
| 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.1-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | tirtc-2.4.1-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 |
72dcd8fdfcd76f3b8ebe4059d26bfc252c7bc13c4e47ca323e901202472671b7
|
|
BLAKE2b-256 checksum How to use checksums |
c8c638537979a1258f23846a3549a76e608450934814852723268a819539f877
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|