当前位置: 首页 > 软件库 > 手机/移动开发 > >

MixedReality-WebRTC

授权协议 MIT License
开发语言 Java
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 墨星鹏
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

MixedReality-WebRTC

MixedReality-WebRTC is a collection of libraries to help mixed reality app developers to integrate peer-to-peer real-time audio and video communication into their application and improve their collaborative experience.

  • Enables multi-track real-time audio / video / data communication with a remote peer
  • Provides an abstracted signaling interface to easily switch implementation
  • Exposes an API for C++ and C# to integrate into existing apps
  • Provides a set of Unity3D components for rapid prototyping and integration
  • Includes support for Microsoft HoloLens (x86) and Microsoft HoloLens 2 (ARM)
  • Allows easy use of Mixed Reality Capture (MRC) to stream the view point of the user for multi-device experiences

MixedReality-WebRTC is part of the collection of repositories developed and maintained by the Mixed Reality Sharing team.

Notice

With the announcement of Microsoft Mesh, we want to provide an update regarding our plans for the future of the MR-WebRTC project. Microsoft Mesh provides a fabric to enable collaborative scenarios for mixed reality that span across multiple platforms and endpoints and has additional features and capabilities beyond what is covered by the MR-WebRTC project. With that in mind, we have decided to scale back our development resources in the MR-WebRTC project and focus those resources into providing a great platform with Microsoft Mesh. For additional information about Microsoft Mesh, please check out our technical overview at https://techcommunity.microsoft.com/t5/mixed-reality-blog/microsoft-mesh-a-technical-overview/ba-p/2176004.

While we are reducing our development investment in MR-WebRTC, we will continue to host it as a project, and accept pull-requests for the project. We also encourage anyone wishing to continue to develop the project to fork it and move forward with it.

If anyone has any questions, please feel free to reach out to Jesse McCulloch from our Developer Ecosystem team at jemccull@microsoft.com.

Download

NuGet (C++, C#) and UPM (Unity) packages are available for stable releases (release/* branches). See the Release page on GitHub or the Download documentation page for details.

Note: The master branch contains the code for the next release, and therefore sometimes contains breaking API changes from the latest stable release. It is therefore not guaranteed to work with NuGet packages, which are only available for stable releases. In particular, the Unity library scripts are only guaranteed to be compatible with NuGet packages if copied from a release/* branch, though it is strongly recommended to use the UPM packages instead.

Build Status

Branch WebRTC API C library (mrwebrtc) C# Library Docs
release/2.0 M71 Stable
master M71 Unstable

The release/2.0 branch contains the latest stable version of the API, from which the NuGet and UPM packages are published.

The master branch contains the current up-to-date code with latest developments. Care is generally taken to keep this branch in a fairly clean state (branch can build, tests pass). However the master branch contains API breaking changes compared to the latest release, and therefore is not compatible with NuGet/UPM packages and should be built from sources instead (see Building from sources documentation).

Documentation

The official documentation is hosted at https://microsoft.github.io/MixedReality-WebRTC/.

User Manual

The User Manual contains a general overview of the various libraries of the project, and some tutorials on how to use them.

  • The Hello, Unity world! tutorial introduces the Unity integration by building a simple audio and video chat client.
  • The C# tutorials introduce the .NET Standard 2.0 C# API, which can be used outside Unity.
    • Hello, C# world! (Desktop) shows how to build a simple console app in .NET Core 3.0, which runs as a Windows Desktop (Win32) app.
    • Hello, C# world! (UWP) shows how to build a GUI app with a UI based on WPF (XAML), including how to render the local and remote video.

API reference

An API reference is available for the C# library and the Unity integration.

Getting Started

MixedReality-WebRTC is a set of individual building blocks in the form of C and C# libraries building upon each other to deliver a consistent API to C/C++ and C# developers across its supported platforms, and a set of handful drop-in Unity3D components for easy integration. The pure C library allows easy integration as a shared module (DLL) into C/C++ projects while avoiding issues with compiler and CRT variants.

Overview

The overall architecture is as follow:

Library Lang Description
mrwebrtc C/C++ Native C/C++ library providing a low-level interface to the underlying WebRTC implementation from Google. Compared to the API exposed by the Google implementation (PeerConnection), the current interface is simplified to remove the burden of setup and configuring. It also tries to prevent common threading errors with the UWP wrappers. This library exposes are pure C API easily integrated into any C/C++ application.
Microsoft.MixedReality.WebRTC C# 7.3 C# .Net Standard 2.0 library providing access to the same API as the native C library, exposed with familiar C# concepts such as async / await and Task.
Microsoft.MixedReality.WebRTC.Unity C# 7.3 Unity3D integration - a set of Unity MonoBehaviour components with almost no required setup, to enable rapid prototyping and simplify integration into an existing app.
Microsoft.MixedReality.WebRTC.Unity.Examples C# 7.3 Unity3D samples showcasing typical use scenarios like a peer-to-peer video chat app.

MixedReality-WebRTC is currently available for Windows 10 Desktop and UWP, with or without Unity, and Android (Unity only).

Note - In the following and elsewhere in this repository the term "Win32" is used as a synonym for "Windows Desktop", the historical Windows API for Desktop application development, and in opposition to the "Windows UWP" API. However Microsoft Windows versions older than Windows 10 with Windows SDK 17134 (April 2018 Update, 1803) are not officially supported for this project. In particular, older versions of Windows (Windows 7, Windows 8, etc.) are explicitly not supported.

Sources

This repository follows the Pitchfork Layout in an attempt to standardize its hierarchy:

bin/               # Binary outputs (generated)
build/             # Intermediate build artifacts (generated)
docs/              # Documentation sources
+ manual/          # User manual sources
examples/          # Examples of use and sample apps
external/          # Third-party external dependencies (git submodules)
libs/              # Source code for the individual libraries
tests/             # Source code for feature tests
tools/             # Utility scripts
+ build/           # Build scripts for the various platforms
  + android/       # Android Studio project to build libmrwebrtc.so
  + libwebrtc/     # Android build scripts for Google's WebRTC library
  + mrwebrtc/      # Windows build tools to build mrwebrtc.dll
+ ci/              # CI Azure pipelines

The Microsoft.MixedReality.WebRTC.sln Visual Studio 2019 solution located at the root of the repository contains several projects:

  • The native C/C++ library mrwebrtc, which can be compiled:
    • for Windows Desktop with the mrwebrtc-win32 project
    • for UWP with the mrwebrtc-uwp project
  • A C/C++ library unit tests project mrwebrtc-win32-tests
  • The C# library project Microsoft.MixedReality.WebRTC
  • A C# unit tests project Microsoft.MixedReality.WebRTC.Tests
  • A UWP C# sample app project Microsoft.MixedReality.WebRTC.TestAppUWP based on WPF and XAML which demonstrates audio / video / data communication by mean of a simple video chat app.

Note - Currently due to CI limitations some projects are downgraded to VS 2017, as the Google M71 milestone the master and release/1.0 branches are building upon does not support VS 2019, and Azure DevOps CI agents do not support multiple Visual Studio versions on the same agent. This will be reverted to VS 2019 eventually (see #14).

Building MixedReality-WebRTC

See the user manual section on Building from sources.

Special considerations for HoloLens 2

  • Mixed Reality Capture (MRC) has some inherent limitations:
    • MRC only works up to 1080p (see the Mixed reality capture for developers documentation), but the default resolution of the webcam on HoloLens 2 is 2272 x 1278 (see the Locatable Camera documentation). In order to access different resolutions, one need to use a different video profile, like the VideoRecording or VideoConferencing ones. This is handled automatically in the Unity integration layer (see here) if WebcamSrouce.FormatMode = Automatic (default), but must be handled manually if using the C# library directly.
    • MRC requires special permission to record the content of the screen:
      • For shared apps (2D slates), this corresponds to the screenDuplication restricted capability, which cannot be obtained by third-party applications. In short, MRC is not available for shared apps. This is an OS limitation.
      • For exclusive-mode apps (fullscreen), there is no particular UWP capability, but the recorded content is limited to the application's own content.
  • Be sure to use PreferredVideoCodec = "H264" to avail of the hardware encoder present on the device; software encoding with e.g. VP8 or VP9 codecs is very CPU intensive and strongly discouraged.

Known Issues

The current version is a public preview under active development, which contains known issues being addressed:

  • HoloLens 2 exhibits some small performance penalty due to the missing support (#157) for SIMD-accelerated YUV conversion in WebRTC UWP SDK on ARM.
  • H.264 hardware video encoding (UWP only) exhibits some quality degrading (blockiness). See #74 and #153 for details.
  • H.264 is not currently available on Desktop at all (even in software). Only VP8 and VP9 are available instead (software encoding/decoding).
  • The NuGet packages (v1.x) for the former C++ library Microsoft.MixedReality.WebRTC.Native include some WebRTC headers from the Google repository, which are not shipped with any of the NuGet packages themselves, but instead require cloning this repository and its dependencies (see #123).

In addition, the Debug config of WebRTC core implementation is known to exhibit some performance issues on most devices, including some higher-end PCs. Using the Release config of the core WebRTC implementation usually prevents this, and is strongly recommended when not debugging.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Reporting security issues and bugs

MixedReality-WebRTC builds upon the WebRTC implementation provided by Google. Security issues and bugs related to this implementation should be reported to Google.

Security issues and bugs related to MixedReality-WebRTC itself or to WebRTC UWP SDK should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

  • 综述 WebRTC 中码率影响视频的帧率和分辨率的调整,在高硬件占用的情况下通过调整码率和帧率也会影响码率;视频评判的重要参数是QP;同时WebRTC也对外提供参数设置最大的分辨率和码率接口,本文就从外部设置帧率和分辨率参数和码率影响两个部分分析源码流程;视频帧分辨率的调整主要是在VideoAdapter类中,其类文件中描述此类的作用如下: VideoAdapter adapts an input

 相关资料
  • 问题内容: 我认为我非常接近让Java服务器应用程序通过WebRTC与浏览器页面对话,但是我不能完全使其正常工作。我感觉自己缺少一些小东西,因此希望这里有人可以提出建议。 我仔细研究了WebRTC示例- Java单元测试()和示例Android应用()。根据所学知识,我编写了一个Java应用程序,该应用程序使用WebSockets进行信号传输并尝试将视频流发送到Chrome。 问题是,即使我所有的

  • 本文向大家介绍详解python的webrtc库实现语音端点检测,包括了详解python的webrtc库实现语音端点检测的使用技巧和注意事项,需要的朋友参考一下 引言 语音端点检测最早应用于电话传输和检测系统当中,用于通信信道的时间分配,提高传输线路的利用效率.端点检测属于语音处理系统的前端操作,在语音检测领域意义重大. 但是目前的语音端点检测,尤其是检测 人声 开始和结束的端点始终是属于技术难点,

  • 问题内容: 我目前在个人开发中使用WebRTC,一切正常。我从网络摄像头获取视频流,但现在我想对使用约束。 当我在Firefox中进行测试时,似乎忽略了约束。当我在Chrome或Opera上进行测试时,我的约束可以很好地工作并且质量很好,有人知道为什么吗?问题是Firefox? 谢谢你的建议 问题答案: 似乎Firefox尚未实施约束。 自Chrome 24和Opera 18开始实施约束。这些约束

  • 本文向大家介绍你有用过webRTC吗?它有什么运用场景?相关面试题,主要包含被问及你有用过webRTC吗?它有什么运用场景?时的应答技巧和注意事项,需要的朋友参考一下 WebRTC代表“Web实时通信”。这基本上允许在浏览器中进行语音、视频聊天和P2P共享(实时通信) 实际应用的要求来源https://www.zhihu.com/question/25497090/answer/43395462

  • 问题内容: 我正在尝试使用适用于Android的WebRTC本机代码包(即不使用WebView)在Android应用程序中实现三向视频聊天。我已经使用node.js编写了一个信令服务器,并使用了客户端应用程序内的Gottox socket.io java客户端 库来连接到服务器,交换SDP数据包并建立2路视频聊天连接。 但是,现在我遇到了无法进行三通通话的问题。WebRTC本机代码包随附的AppR

  • 问题内容: 大约六个月前,我能够用PHP成功编写自己的WebSocket服务器脚本。这样,我就可以在本地主机上设置WebRTC视频聊天服务。在意识到要进行部署之前,我很高兴,我需要一个可以访问套接字的Web服务器。 不幸的是,没有共享的Web托管允许套接字,并且所有提供套接字的Web服务器都很昂贵。虽然这不是一个大规模的有效解决方案,但是为了建立一个演示来展示给人们看,我想将信令方法从WebSoc