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. Jar 包 及运行Jar包 - 转载

    Eclipse的jar file和Runnable JAR file的区别 - 及bat运行Runnable JAR文件 1.两种jar的区别 jar file是最普通的jar包,即平时我们工程中li ...

  2. SQLServer行列转换PIVOT函数中聚合函数的使用意义及选择

    例子:https://blog.csdn.net/wikey_zhang/article/details/76849826 DECLARE @limitDay INT;SET @limitDay = ...

  3. python学习笔记(excel简单操作)

    现在的目标是设计一个接口自动化测试框架 用例写在excel里面 利用python自带的pyunit构建 之前已经安装好了处理excel的模块 这次简单的使用下 提前创建好excel文件 “testca ...

  4. shell awk命令

    语法: awk '{command}' filename  多个命令以分号分隔. awk 'BEGIN {command1} {command2} END{command3}'  注意:BEGIN , ...

  5. mysql中的左连接右连接内连接

    一. 初始化SQL语句 /*join 建表语句*/ drop database if exists test; create database test; use test; /* 左表t1*/ dr ...

  6. LinuxMint Mate 安装Google拼音输入法(Fcitx)

    安装Google拼音输入法(Fcitx)$ sudo apt-get install fcitx fcitx-config-gtk fcitx-frontend-all fcitx-ui-classi ...

  7. win8里DNW的裸机程序下载

    1. win8要装DNW驱动首先要禁止驱动数字签名(参考百度经验:http://jingyan.baidu.com/article/3f16e003d1f4612591c103ce.html) 2.然 ...

  8. webpack4工具链升级排坑记录

    1.webpack4号称是0配置,于是我就只设置了entry.resolve.output.module->rules之类的属性,结果通过webpack-bundle-analyzer跑出来发现 ...

  9. ADO.NET数据库访问技术(转)

    这几天的自学,现在总结一下关于C#中连接数据库的一些知识点: 1.使用Connection连接数据库的步骤: (1).添加命名空间 System.Data.SqlClient(注意:初学者经常会忘记) ...

  10. 事件穿透父层 直达子层 pointer-events:none

    之前我也做过一些canvas特效,往往在canvas全屏时,canvas下层的div就无法进行dom的事件操作,点击之类的就失灵了.之前我的做法要么就是在canvas上加入点击事件,穿透到下层,或者把 ...