当前位置:网站首页>How does webrtc obtain video stream data on the C ++ side?
How does webrtc obtain video stream data on the C ++ side?
2022-06-24 13:22:00 【Tsingsee green rhino video】
WebRTC Is an open source technology , It can realize voice and video communication through web pages , Without having to install any plug-ins in the browser . Now ,WebRTC The technology is mature , It integrates the best sound / Video Engine , This technology has been widely used in video calls .
stay WebRTC Development process , Will be far away sdp Once you set it up , Then you can get the video data stream . If it is js End , So the operation is actually relatively simple . however C++ The end is a little troublesome . because WebRTC With a... On the top Javascript API layer , You can use it in your browser . This makes it easier to develop and integrate real-time communications anywhere . In the internal ,WebRTC Still mainly used C / C ++ Realization .
Some developers don't know how to get WebRTC C++ Video stream data at the end . Today we will share this development skill with you :WebRTC How to get C ++ Video stream data at the end .
1、 First , stay WebRTC in src/api/create_peerconnection_factory.h There is a function to create a peer-to-peer connection factory , And return an instance interface . The code is as follows :
2、 After the peer factory is created , stay src/api/peer_connection_interface There are peer connections in , Use a peer factory to create this peer connection instance . The code is as follows :
3、 See here , We just need to pay attention CreatePeerConnection The last argument to the function . This parameter needs to be overridden , There are many virtual functions that need to be rewritten . Roughly rewritten ICE、 Track and connection status, etc .
4、 At this step, you should find out how to obtain video data stream . There is a method of audio rewriting OnTrack function , This function is responsible for monitoring the video stream instance .
5、 Responsible for rewriting webrtc::PeerConnectionObserver The virtual function in the function , The implementation can monitor the transmitted stream information . Get video stream data , Just pay attention OnTrack function :
webrtc::RtpTransceiverInterface Interface found receiver() Method , In from receiver() Method track() Method ,track() The method is to get the information of the video stream .
WebRTC Not just voice and video , It's powerful and versatile , That's why WebRTC Because technology is becoming more and more popular .
Based on open source WebRTC Technical development EasyRTC Video conferencing cloud services , It's widely used in education 、 Finance 、 Health care 、 Enterprise training 、 Telecommuting, etc , All browsers that support current technology include Google Chrome,Mozilla Firefox,Apple Safari and Microsoft Edge. Not just browsers ,EasyRTC It can also support wechat applet 、H5 page 、APP、PC Interworking between client and other access methods , Building real-time audio and video communication from scratch ; Support video calls from multiple to one million people , Meet voice and video social .
边栏推荐
- Megacli online management raid installation and use steps
- 1. Snake game design
- Sphere, openai and ai21 jointly publish the best practice guidelines for deployment models
- The text to voice function is available online. You can experience the services of professional broadcasters. We sincerely invite you to try it out
- Opengauss kernel: simple query execution
- 面试官:MySQL 数据库查询慢,除了索引问题还可能是什么原因?
- Preparation and operation & Maintenance Guide for 'high concurrency & high performance & high availability service program'
- YOLOv6:又快又准的目标检测框架开源啦
- Several common DoS attacks
- IIS WCF 808 port service access exception
猜你喜欢

Getting started with the lvgl Library - colors and images

我真傻,招了一堆只会“谷歌”的程序员!

青藤入选工信部网安中心“2021年数字技术融合创新应用典型解决方案”

‘高并发&高性能&高可用服务程序’编写及运维指南

go Cobra命令行工具入门

Use abp Zero builds a third-party login module (I): Principles

爱可可AI前沿推介(6.24)

Getting started with the lvgl Library - colors and images

几种常见的DoS攻击

The agile way? Is agile development really out of date?
随机推荐
DTU上报的数据值无法通过腾讯云规则引擎填入腾讯云数据库中
105. simple chat room 8: use socket to transfer pictures
我从根上解决了微信占用手机内存问题
Beauty of script │ VBS introduction interactive practice
AGCO AI frontier promotion (6.24)
爱可可AI前沿推介(6.24)
Leetcode 1218. 最长定差子序列
Sphere, openai and ai21 jointly publish the best practice guidelines for deployment models
Are you still working hard to select *? Then put away these skills
华为AppLinking中统一链接的创建和使用
Attack popular science: DDoS
Configuration (enable_*) parameter related to execution plan in PG
Getting started with the go Cobra command line tool
Richard Sutton, the father of reinforcement learning, paper: pursuing a general model for intelligent decision makers
How stupid of me to hire a bunch of programmers who can only "Google"!
I enlighten a friend and my personal understanding of the six patriarchs' Tan Jing
一文讲透研发效能!您关心的问题都在
Understanding openstack network
MySQL master-slave replication
About the hacked database