本文主要是介绍webrtc lib 编译及定制化开发资源,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
webrtc 拉取及编译,使用了国内镜像源,直接避免直接git clone time out
https://blog.csdn.net/jsf921942722/article/details/102934186?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EOPENSEARCH%7Edefault-17.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EOPENSEARCH%7Edefault-17.control
Webrtc代码获取 ,适用于VPN代理配置git代理# 设置代理
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.19:1080'# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy配置HTTP代理sudo apt-get install privoxy
# 修改配置
sudo vim /etc/privoxy/config#添加
forward-socks5 / 127.0.0.1:1080 .#重启
sudo /etc/init.d/privoxy restart安装depot_toolsA tutorial introduction to the Chromium depot_tools git extensions.# 下载
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
# 添加到环境变量
export PATH=$PATH:/home/frank/webrtc/depot_tools1:创建boto.cfg文件
2:配置如下内容[Boto]proxy=127.0.0.1proxy_port=8118
3: 设置环境变量NO_AUTH_BOTO_CONFIGexport NO_AUTH_BOTO_CONFIG=/home/frank/webrtc/boto.cfg安装依赖项export http_proxy=http://127.0.0.1:8118/
export https_proxy=http://127.0.0.1:8118/
wget https://cs.chromium.org/chromium/src/build/install-build-deps.shsudo install-build-deps.sh
sudo install-build-deps-android.sh下载代码mkdir webrtc_android && cd webrtc_android
fetch --nohooks webrtc_android
gclient sync
# gclient sync --nohooks --with_branch_heads编译代码gn gen out/Debug --args='target_os="android" target_cpu="arm"'
ninja -C out/Debug#To build for ARM64: use target_cpu="arm64"
#To build for 32-bit x86: use target_cpu="x86"
#To build for 64-bit x64: use target_cpu="x64"
webrtc lib 接口
https://github.com/flutter-webrtc/libwebrtc
- 将webrtc源码下载到webrtc中,请参考上面连接
cd webrtc/src
git clone https://github.com/cloudwebrtc/libwebrtc.git
- 修改 webrtc 的 src/BUILD.gn 文件并将 libwebrtc 添加到 group("default")。
diff --git a/BUILD.gn b/BUILD.gn
索引 bfe6d02ab9..2c0eaaa631 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -30,6 +30,7 @@ if (!build_with_chromium) {testonly = 真深度 = [":webrtc",
+ "//libwebrtc:libwebrtc",]如果(rtc_build_examples){deps += [“示例”]
- 编译
ninja -C out/Default libwebrtc
生成libwebrtc.so
库文件,可以用于嵌入式环境
关于webrtc的定制化开发
交叉编译的脚本参考
./build/install-build-deps.sh --arm./build/linux/sysroot_scripts/install-sysroot.py --arch=armgn gen out/Default --args='target_os="linux" target_cpu="arm"'ninja -C out/Default libwebrtc
#32位arm
./build/linux/sysroot_scripts/install-sysroot.py --arch=armgn gen out/linux_Arm --args='target_os="linux" target_cpu="arm" arm_arch="armv7-a" arm_tune="cortex-a7" arm_version=7 arm_optionally_use_neon=true arm_fpu="neon-vfpv4" is_clang=false is_debug=false is_nacl_glibc=true libyuv_use_neon=true rtc_build_with_neon=true rtc_include_internal_audio_device=false rtc_include_pulse_audio=false rtc_libvpx_build_vp9=false rtc_use_gtk=false strip_debug_info=true treat_warnings_as_errors=false use_aura=false use_dbus=false use_gold=true use_goma=false use_lld=false use_ozone=false use_udev=false rtc_build_examples=false rtc_build_tools=false rtc_include_tests=false use_glib=false rtc_use_x11 = false arm_float_abi="softfp" rtc_use_pipewire=false use_custom_libcxx=false rtc_use_h264=true proprietary_codecs=true rtc_enable_protobuf=false use_rtti=true rtc_build_json=true ffmpeg_branding="Chrome" use_openh264=true use_custom_libcxx_for_host=false'gn gen out/linux_Arm --args='target_os="linux" target_cpu="arm" arm_arch="armv7-a" arm_tune="cortex-a7" arm_version=7 arm_optionally_use_neon=true arm_fpu="neon-vfpv4" is_clang=false is_debug=false is_nacl_glibc=false arm_float_abi="softfp" libyuv_use_neon=true rtc_build_with_neon=true rtc_include_internal_audio_device=false rtc_include_pulse_audio=false rtc_libvpx_build_vp9=false rtc_use_gtk=false strip_debug_info=true treat_warnings_as_errors=false use_aura=false use_dbus=false use_gold=true use_goma=false use_lld=false use_ozone=true use_udev=false rtc_build_examples=false rtc_build_tools=false rtc_include_tests=false rtc_use_x11 = false use_custom_libcxx=false rtc_use_h264=true proprietary_codecs=true rtc_use_pipewire=false rtc_enable_protobuf=false use_rtti=true rtc_build_json=true ffmpeg_branding="Chrome" use_openh264=true use_custom_libcxx_for_host=false'
ninja -C out/linux_Arm libwebrtc
在嵌入式设备中实现webrtc的第三种方式
https://www.cnblogs.com/Johness/p/implement-webrtc-in-embedded-system-sec-1.html
amazon-kinesis提供的设备端sdk
https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c
基于 WebRTC 实现自定义编码分辨率发送
https://blog.csdn.net/netease_im/article/details/113011821?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_baidulandingword-1&spm=1001.2101.3001.4242
交叉编译需要根据硬件平台的类型变更编译工具链,另外webrtc只支持V4L2_BUF_TYPE_VIDEO_CAPTURE,不支持
V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,如需要添加支持需更改
webrtc/src/modules/video_capture/linux/device_info_linux.cc中的
int32_t DeviceInfoLinux::FillCapabilities(int fd) 函数实现
webrtc/src/modules/video_capture/linux/video_capture_linux.cc中
int32_t VideoCaptureModuleV4L2::StartCapture(
const VideoCaptureCapability& capability)
bool VideoCaptureModuleV4L2::AllocateVideoBuffers()
bool VideoCaptureModuleV4L2::DeAllocateVideoBuffers()
bool VideoCaptureModuleV4L2::CaptureThread(void* obj)
这几个函数的实现,增加对mplane的支持
如果需要对接自己硬件平台的编解码mpp等
WebRTC Android端软件/硬件编解码的策略
https://blog.csdn.net/sonysuqin/article/details/82954939
https://blog.csdn.net/tanningzhong/article/details/78672546?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-4.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-4.control
https://blog.csdn.net/chenshukui8300/article/details/100920286?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-2.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-2.control
WebRTC的视频解码原理简析
https://blog.csdn.net/fanyun_01/article/details/88936945?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-11.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-11.control
OBS studio is a very popular stable open source live streaming software, with some H264 encoder integrated, such as
- obs_x264, software;
- INTEL obs_qsv11, hardware;
- AMD amd_amf_h264, hardware;
- NVIDIA ffmpeg_nvenc, hardware.
https://github.com/sonysuqin/WebRTCOBSEncoder
网易云信博客,里面有很多webrtc的应用研究
https://mp.sohu.com/profile?xpt=MTAwMzQ2NDAyOTAxMzg2MDM1MkBzb2h1LmNvbQ==&_f=index_pagemp_2&spm=smpc.content.author.3.1622686810643uK8epT7
这篇关于webrtc lib 编译及定制化开发资源的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!