This is a very simple demonstration of how to stream from a native application to the browser using WebRTC.

But first, a small demonstration of how a call is set up in WebRTC. A call is established by exchanging SDP and ICE information using some unspecified method. In the movie below, I simply copy-paste the required information from a 'sender' web page to a 'receiver' web page. The sender is the one that captures the webcam and streams it to the receiver where it is displayed in a video tag.

(best viewed full screen)

If you'd like to try this yourself, these are the pages:

I've noticed that the copy-pasting needs to be done rather swiftly to get it to work.

Although my hand waving skills are undoubtedly very impressive, it would be great to be able to stream something else to the browser. The following video demonstrates a small native Qt application which streams the contents of a widget to a browser. The call set up is still done using the copy-paste technique, to keep the code in the application to a minimum.

The source of this application is available in two formats:

 
  • patch against the WebRTC source tree (I used revision 5628).

     
    1. First, do the 'gclient config' and 'gclient sync' steps as described on that page.
    2. Apply the patch
    3. Go to the trunk/talk/examples/qtwebrtc_textedit directory and run the runme.sh script (runs the uic and moc commands, I didn't figure out how to do this in the gyp file)
    4. Run the ./webrtc/build/gyp_webrtc command to generate the ninja build files
    5. Run ninja to build everything
     
  • tarball containing a qmake project file to build everything.
     
    1. Make sure you've got WebRTC compiled somewhere.
    2. Extract the tarball somewhere
    3. Run 'qmake WEBRTCTRUNK=/path/to/webrtc/trunk' and make

Although the source code itself probably also works in Windows, I've only tested it on Linux and the patch/qmake file are Linux specific. For the qmake project, you may need to remove some libraries or add some extra libraries, depending on the WebRTC build settings on your platform. The project file is for Qt 5.

Big thanks to Kam for making the modified peerconnection code available, it really helped getting me started using the native WebRTC library.

from:http://research.edm.uhasselt.be/jori/page/Misc/QtWebRTC.html

Qt WebRTC demo的更多相关文章

  1. WebRTC Demo - getUserMedia()

    WebRTC介绍 WebRTC提供三类API: MediaStream,即getUserMedia RTCPeerConnection RTCDataChannel getUserMedia已经由Ch ...

  2. am335x Qt SocketCAN Demo hacking

    /*********************************************************************************** * am335x Qt Soc ...

  3. qt的demo中,经常可以看到emum

    最近开始看QT的文档,发现了很多好东西,至少对于我来说 收获很多~~~ 当然很多东西自己还不能理解的很透彻,也是和朋友讨论以后才渐渐清晰的,可能对于QT中一些经典的用意我还是存在会有些认识上的偏差,欢 ...

  4. Qt: 时钟Demo

    其实是一个很简单的Demo,可以编译了拿NSIS打包.最近在做富文本编辑器和补C++不记得的东西吧,项目遥遥无期. //clock.pro #----------------------------- ...

  5. QT Linux Demo程序编译

    我手上的qt源码包为:qt-everywhere-opensource-src-4.7.0.tar.gz 在Linux下编译比较容易,解压后直接 ./configure,一般会报缺少什么库这些.自己遇 ...

  6. Qt+ECharts开发笔记(三):ECharts的柱状图介绍、基础使用和Qt封装Demo

    前言   上一篇成功是EChart随着Qt窗口变化而变化,本篇将开始正式介绍柱状图介绍.基础使用,并将其封装一层Qt.  本篇的demo实现了隐藏js代码的方式,实现了一个条形图的基本交互方式,即Qt ...

  7. Qt+ECharts开发笔记(五):ECharts的动态排序柱状图介绍、基础使用和Qt封装Demo

    前言   上一篇的demo使用隐藏js代码的方式,实现了一个饼图的基本交互方式,并预留了Qt模块对外的基础接口.  本篇的demo实现了自动排序的柱状图,实现了一个自动排序柱状图的基本交互方式,即Qt ...

  8. webRTC demo

    准备: 信令服务 前端页面用于视频通话 demo github 地址. 前端页面 为了使 demo 尽量简单,功能页面如下,即包含登录.通过对方手机号拨打电话的功能.在实际生成过程中,未必使用的手机号 ...

  9. RPi:QT+wiringPi demo程序

    一个项目里面要用到这玩意儿,网上查了几篇文章凑出来最后还是不行,自己灵机一动就成了. 今天再次搜索的时候,发现另一篇文章已经讲明白了,真是欲哭无泪 程序大部分参考的是之前学qt的摸索出来的,其实只要在 ...

随机推荐

  1. QTableWidget 列排序

    connect(uirecord.tableWidget->horizontalHeader(),SIGNAL(sectionClicked(int)),this,SLOT(record_sor ...

  2. java PreparedStatement和statement的区别

    1. PreparedStatement接口继承Statement, PreparedStatement 实例包含已编译的 SQL 语句,所以其执行速度要快于 Statement 对象.2.作为 St ...

  3. $1...$9 属性 (RegExp) (JavaScript)

    返回在模式匹配期间找到的,所存储的最近的九个部分. 只读.     RegExp.$n 参数     RegExp 始终为全局 RegExp 对象. n 1 至 9 之间的任意整数. 备注     每 ...

  4. HTML5 地理定位 【来自百度应用分享平台】

    百度给的地图API接口相当完善,复制过来一下,以后备用 基本使用方法: <!--引入百度地图API--> <scriptsrc="http://api.map.baidu. ...

  5. Ubuntu 18.04 编译 ijkplayer

    Ubuntu 18.04 编译 ijkplayer 1. 配置安装源 https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu 2. 配置好安装源后,安装一些组 ...

  6. zzuli 2172 队列优化dp

    2172: GJJ的日常之购物 Time Limit: 3 Sec  Memory Limit: 128 MBSubmit: 9  Solved: 8 SubmitStatusWeb Board De ...

  7. main函数的一点知识

    main函数参数意义. main函数执行前. main还是执行后.

  8. eclipse 远程调试tomcat6

    一.tomcat6配置 1.修改tomcat\bin目录下的startup.bat如下,红色部分是新增的,修改后另存为jpda.bat set JPDA_ADDRESS=8114set JPDA_TR ...

  9. Django的 CBV和FBV

    FBV CBV 回顾多重继承和Mixin 回到顶部 FBV FBV(function base views) 就是在视图里使用函数处理请求. 在之前django的学习中,我们一直使用的是这种方式,所以 ...

  10. C++轮子队 敏捷冲刺

    团队Github地址:https://github.com/Pryriat/2048.git 敏捷开发——第1天 Alpha阶段第1次Scrum Meeting 敏捷开发起始时间 2018/10/27 ...