![](https://img.kancloud.cn/25/1d/251d713b6fb0859666334feeec1cbfe1_301x435.png)在直播页面初始化美颜菜单UI和MHBeautyManager后,即构的美颜与其他SDK稍有不同。首先检查工程中是否有下图的advanced文件以及里面的类文件(After initializing the beauty menu UI and MHBeautyManager on the live broadcast page, the beauty constructed is slightly different from other SDKs. First, check whether there are advanced files and class files in the project)。
如果没有的话,请点击链接下载直播Demo,国内用户推荐码云<https://gitee.com/zegodev/ZegoLiveDemo5Rtp.git>
如果上面的链接无效的话,请去即构官网下载直播Demo。(If not, please go to the official website of instant construction to download the live demo.)
将advanced文件夹和ZegoAVKitManager拷贝到当前工程中。然后需要修改文件(Copy the advanced folder and ZegoAVKitManager to the current project. Then you need to modify the file):
- 初始化Zego的时候调用方法(call the method when initializing Zego)
```
[ZegoDemoHelper setRecordTime:YES];
```
- ZegoAVKitManager.h, Add code:
```
+ (void)setBeautyManager:(MHBeautyManager *)beautyManager;
```
- ZegoAVKitManager.m实现这个方法(Implement this method):
```
+(void)setBeautyManager:(MHBeautyManager *)beautyManager {
if(g_filterFactory){
[((ZegoVideoFilterFactoryDemo *)g_filterFactory) setBeautyManager:beautyManager];
}
}
```
- ZegoVideoFilterDemo.h add
```
#import <MHBeautySDK/MHBeautyManager.h>
```
按照图示添加红框的代码(Add the code with red box as shown in the figure):
![](https://img.kancloud.cn/8a/ce/8ace3cb58fc1f9fe688dfa9621f84119_1346x1142.png)
- ZegoVideoFilterDemo.m :
按照图示在对应的位置添加红框的代码(Add the code of red box at the corresponding position as shown in the figure):
![](https://img.kancloud.cn/5a/57/5a577fde6883c89df2f44ae1f8918ab6_819x709.png)
- 渲染方法中添加调用beautyManager的渲染方法(Add a rendering method that calls beautymanager to the rendering method):
video\_capture\_external\_demo.h
![](https://img.kancloud.cn/d8/5e/d85e87f49fe50b48fe25b505be8bfaf2_957x645.png)
video\_capture\_external\_demo.m :
```
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection {
CMTime pts = CMSampleBufferGetPresentationTimeStamp(sampleBuffer);
CVImageBufferRef buffer = CMSampleBufferGetImageBuffer(sampleBuffer);
OSType formatType = CVPixelBufferGetPixelFormatType(pixelBuffer);
[_beautyManager processWithPixelBuffer:pixelBuffer formatType:formatType];
}
```
- 销毁beautyManager(destroy beautymanager)
```
- (void)zego_stopAndDeAllocate{
if (_beautyManager) {
[_beautyManager destroy];
_beautyManager = nil;
}
}
```
- 美狐SDK接入文档
- Meihu SDK Access Document
- (Untitled)
- 一、基础描述(Basic description)
- 1. 最新特性 (Latest features)
- 2. 支持平台 (Support platform)
- 二、集成步骤 (Integration steps)
- 3. 配置工程(Configuration Engineering)
- 4. 使用 MHUI (Use MHUI)
- 5. 腾讯直播 SDK/短视频SDK (Tencent live SDK / short video SDK)
- 6. 金山直播SDK (Jinshan)
- 7. 七牛直播SDK (Qiniu Live)
- 8. 七牛短视频SDK (Qiniu ShortVideo)
- 9. Movieous短视频 (Movieous short Video)
- 10. 即构直播SDK (Zego live)
- 11. 即构实时音视频SDK(Zego Real time audio and video)
- 12. 新版Zego(即构)实时音视频(New Zego Real time audio and video)
- 13. 网易直播 (NetEase live)
- 14. 腾讯互动直播 (Tencent interactive live broadcast)
- 15. 腾讯实时音视频(Tencent real-time audio and video)
- 16. 融云实时音视频 (SealRTC)
- 17. 声网视频通话 (Agora video call)
- 18. 声网直播 (Agora Live)
- 19. 阿里直播 (Ali Live)
- 20. 阿里音视频 SDK美颜
- 三、对接说明 (Docking instructions)
- 四、常见问题(common problem)
- 2. 美颜无效果(Beauty has no effect)
- 3. 贴纸下载失败(Sticker download failed)
- 4. 点击无法出现美颜菜单页(The beauty menu page cannot appear after clicking)
- 5. 英文版显示中文(The beauty menu page cannot appear after clicking)
- 6. 语言切换功能(Language switching function)