Files
babelive_and/README.md
2026-02-06 15:19:35 +08:00

107 lines
5.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# babeLive
## **SDK 集成**
#### **模块与架构分层**
![project_design](./project_design.png)
#### **模块依赖关系**
![module_dependencies](./module_dependencies.png)
#### **模块功能介绍**
```html
.
├── AndroidThirdParty # 三方依赖目录用于管理项目依赖的三方SDK及版本
│   └── config.gradle
├── LiveApp # Demo Application入口
├── LiveBasic # 基础直播目录,包含所有基础直播的功能模块
│   ├── live_pull # RTMP基础直播拉流功能
│   ├── live_pull_rts # RTS低延迟直播拉流功能
│   ├── live_push # 摄像头推流功能
│   └── live_screencap # 录屏推流功能
├── LiveBeauty # 直播美颜目录,包含基础直播/互动直播的美颜前处理解决方案
│   ├── README.md # 直播美颜说明文档
│   ├── live_beauty # 直播美颜-抽象接口模块
│   └── live_queenbeauty # 直播美颜-基于Queen SDK的封装实现模块
├── LiveCommon # 公共组件目录包含Demo工具类、公共业务等
│   ├── live_commonbiz # 直播Demo公共业务模块
│   ├── live_commonui # 直播Demo公共UI模块
│   └── live_commonutils # 直播Demo工具类模块
├── LiveInteractive # 互动直播目录,包含所有互动直播的功能模块
│   ├── live_barestream # 互动直播-推拉裸流功能
│   ├── live_interactive # 互动直播-连麦功能
│   ├── live_interactive_common # 互动直播-公共模块
│   └── live_pk # 互动直播-PK功能
├── README.md # 项目说明文档
├── build.gradle
├── gradle
│   └── wrapper
```
#### **功能列表**
| 功能名称 | 模块名称 | 功能场景 | 推拉流协议 |
| ---------- | ---------------- | -------------- | ------------------------------------------------------------ |
| 摄像头推流 | live_push | 推流(摄像头) | 基础直播(rtmp/rts 1.0/rts 2.0),互动直播(rtc),推拉裸流(rts 2.0) |
| 录屏推流 | live_screencap | 推流(录屏) | 基础直播(rtmp/rts 1.0/rts 2.0) |
| 拉流播放 | live_pull | 拉流 | 基础直播(rtmp/rts 1.0/rts 2.0) |
| 连麦互动 | live_interactive | 推拉流(连麦) | 互动直播(rtc) |
| PK互动 | live_pk | 推拉流PK | 互动直播(rtc) |
| 推拉裸流 | live_barestream | 推拉流 | 推拉裸流(rts 2.0) |
----
## **SDK 集成**
### **推荐使用 Maven 集成:**
| SDK名称 | SDK类型 | 功能 | 支持模式 | 推拉流协议 |
| --------------------------- | ------------- | ------ | ------------------ | ------------------------------------------------------------ |
| AlivcLivePusher | 推流SDK | 推流 | 基础模式 | 基础直播(rtmp/rts 1.0/rts 2.0) |
| AlivcLivePusher_Interactive | 推流SDK | 推流 | 基础模式、互动模式 | 基础直播(rtmp/rts 1.0/rts 2.0),互动直播(rtc),推拉裸流(rts 2.0) |
| AliVCSDK_BasicLive | 音视频终端SDK | 推拉流 | 基础模式 | 基础直播(rtmp/rts 1.0/rts 2.0) |
| AliVCSDK_InteractiveLive | 音视频终端SDK | 推拉流 | 基础模式、互动模式 | 基础直播(rtmp/rts 1.0/rts 2.0),互动直播(rtc),推拉裸流(rts 2.0) |
| AliVCSDK_Standard | 音视频终端SDK | 推拉流 | 基础模式、互动模式 | 基础直播(rtmp/rts 1.0/rts 2.0),互动直播(rtc),推拉裸流(rts 2.0) |
### **1. 配置License**
推流 SDK 需要 License 授权才能正常使用,请参考 [推流 SDK License 集成指南](https://help.aliyun.com/zh/live/developer-reference/integrate-a-push-sdk-license) 完成配置。
### **2. 添加 Maven 源**
在项目的 build.gradle 文件中添加以下 Maven 源地址:
```groovy
maven { url 'https://maven.aliyun.com/nexus/content/repositories/releases' }
```
### **3. 在 build.gradle 中添加依赖**
根据业务需求选择对应的 SDK 版本进行集成:
```groovy
// 1. 基础版推流 SDK不支持连麦
implementation 'com.alivc.pusher:AlivcLivePusher:x.y.z'
// 2. 互动版推流 SDK支持连麦
implementation 'com.alivc.pusher:AlivcLivePusher_Interactive:x.y.z'
```
**注意**`x.y.z` 表示推流 SDK 的版本号。您可以在 [SDK 下载页面](https://help.aliyun.com/zh/live/developer-reference/sdk-download-and-release-notes) 查看最新稳定版本号,并将其替换为实际值。
### **4. 配置 CPU 架构**
目前 SDK 支持 armeabi-v7a 和 arm64-v8a不支持模拟器调试。请在 defaultConfig 中配置:
```groovy
defaultConfig {
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
}
```