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. MSSQL2005数据库显示单一用户模式,无法进行任何操作

    MSSQL2005数据库显示单一用户模式,无法进行任何操作 经查询,使用exec sp_who进行查看链接线程,发现仍然有链接不断进行请求,将链接踢出,然后通过命令修复即可恢复 处理步骤: exec ...

  2. Ajax基础(三)--eval的使用

    eval的使用: 1.定义和用法 计算某个字符串,并执行其中的js代码 eval(string) string必须,含有表达式或执行语句 string有返回值的话 2.实例 2.1 字符串上该用eva ...

  3. c语言中的string

    1. strlen(char const* s); 函数传入的是c风格字符串(即以‘\0’结尾的字符数组),返回的长度为size_t(即unsigned int),其长度不包括'\0'. 2. str ...

  4. 牛客比赛-状压dp

    链接:https://www.nowcoder.com/acm/contest/74/F来源:牛客网 德玛西亚是一个实力雄厚.奉公守法的国家,有着功勋卓著的光荣军史. 这里非常重视正义.荣耀.职责的意 ...

  5. Ceph配置项动态变更机制浅析

    转自:https://www.ustack.com/blog/ceph%e9%85%8d%e7%bd%ae%e9%a1%b9%e5%8a%a8%e6%80%81%e5%8f%98%e6%9b%b4%e ...

  6. oracle内存分析

    oracle时间内存=SGA+PGA SGA(System Global Area):由所有服务进程和后台进程共享: PGA(Program Global Area):由每个服务进程.后台进程专有:每 ...

  7. [eShopOnContainers 学习系列] - 03 - 在远程 Ubuntu 16.04 上配置开发环境

    直接把 md 粘出来了,博客园的富文本编辑器换成 markdown,没啥效果呀 ,先凑合吧.实在不行换地方   # 在远程 Ubuntu 16.04 上配置开发环境 ## 零.因 为什么要用这么麻烦的 ...

  8. 【linux】基础知识学习

    [版本] 两种:内核版本 . 发行版本 内核版本从 www.kernel.org 查看 发行版本: 1.retHat, centOS 更稳定,更安全,适宜做企业服务器 2.ubuntu, Debian ...

  9. laravel发送邮件

    这里已163为例: 1..env文件配置和mail.php配置(默认使用.env) MAIL_DRIVER=smtp MAIL_HOST=smtp.163.com MAIL_PORT=465 MAIL ...

  10. build.prop文件介绍与用法举例

    build.prop 是一个属性文件,在Android系统中.prop文件很重要,记录了系统的设置和改变 以下是修改教程及一些build.prop参数的中英文对照解释,修改前,注意先备份原build. ...