用yangwebrtc使用gpu编码器搭建游戏教育等在线低延迟直播

概述

        webrtc实现大多为软编码,CPU负载重,性能较硬编码低,利用GPU进行编码可以大大提高编码效率,并降低系统负载和延迟。

下载源码和运行类库

https://github.com/metartc/yangwebrtc/releases/tag/2.0.058https://github.com/metartc/yangwebrtc/releases/tag/2.0.058https://gitee.com/metartc/yangwebrtc/releases/2.0.058https://gitee.com/metartc/yangwebrtc/releases/2.0.058

metartc2_with_3rdparty.058.7z为源码压缩文件,metartc2_win_runtime.7z为应用程序依赖的dll文件

编译视频参考

metartc(yangwebrtc)windows版本编译教程_哔哩哔哩_bilibilimetartc(yangwebrtc)编译教程https://www.bilibili.com/video/BV1d3411r742/配置参数

修改配置文件include/Yang_Config.h

将#define Yang_GPU_Encoding 0改为 #define Yang_GPU_Encoding 1

  指定GPU类型,windows版支持Nvdia和Intel两种。

编译yangwincodec工程

编译后的文件在bin/lib_win_debug下

 编译yangpushstream2

 设置ARGB格式

demo默认格式为I420,GPU编码时需用CPU进行格式转换,如果设置为YangArgb,格式转换在GPU中,不需要CPU,可以提高编码效率。

Remark:demo目前不支持argb格式预览。

编译后debug运行

 直播桌面,选中屏幕复选框

虚拟背景直播,选中VR复选框

webrtc服务器

推荐Srs4.0,下载编译参考http://github.com/ossrs/srs#usage

​      objs/srs -c conf/https.rtc.conf

可支持webrtc/rtmp/hls/srt/httpflv等直播。

猜你喜欢

转载自blog.csdn.net/m0_56595685/article/details/121575105