gstreamer中使用webrtc

gstreamer官方源代码中有一个基于webrtc插件实现音视频通话的开源项目,下面介绍在Ubuntu系统中如何搭建环境并使用。

一、环境搭建
1.安装依赖库
这里省略gstreamer安装,直接安装使用webrtcbin插件使用的相关库,参考官网。系统版本建议高于ubuntu18.04。
首先安装如下相关依赖库。

sudo apt-get install -y gstreamer1.0-tools gstreamer1.0-nice gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-plugins-good libgstreamer1.0-dev git libglib2.0-dev libgstreamer-plugins-bad1.0-dev libsoup2.4-dev libjson-glib-dev

gstreamer项目编译官方建议使用meson和ninja。https://gitlab.freedesktop.org/gstreamer/gst-build/

sudo apt-get install meson ninja-build

如果想使用虚拟环境编译运行,官方推荐使用hotdoc,安装使用参考官方网页。

我这里使用的系统是Ubuntu22.04,gst版本为1.20。

2.编译运行
gst-webrtc开源项目在gst官方源码gst-examples目录下。下载对应版本压缩包,或者直接git克隆。

cd /path/gst-examples
meson build

环境没问题会显示

The Meson build system
Version: 1.2.1
Source dir: /home/cht/gst/gst-examples
Build dir: /home/cht/gst/gst-examples/reconfigure
Build type: native build
Project name: gst-examples
Project version: 1.19.2
C compiler for the host machine: cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C linker for the host machine: cc ld.bfd 2.38
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: YES
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency glib-2.0 found: YES 2.72.4
Run-time dependency gio-2.0 found: YES 2.72.4
Run-time dependency gobject-2.0 found: YES 2.72.4
Run-time dependency gmodule-2.0 found: YES 2.72.4
Run-time dependency gstreamer-1.0 found: YES 1.20.3
Run-time dependency gstreamer-play-1.0 found: YES 1.20.3
Run-time d
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值