Video & Audio Conference on Unity3D using WebRTC and LiveSwitch
by Florian AuerAR, Unity3D, LiveSwitch, IceLinkMay 04, 2019 (updated July 06, 2020)
Video & Audio Conference for Unity3D using WebRTC by LiveSwitch / IceLink for every platform FrozenMountain supports.
Including multi-party conferencing (SFU & MCU).
[Update]
Currently, we are reimplementing all of this with additional features, forming an SDK ready to use with existing LiveSwitch or IceLink implementations.
If you want to join our upcoming private beta, send an email to ls4unity-beta@auerflorian.com including your usecase.
About the project
To support video & audio conferencing on the three target platforms, LiveSwitch from FrozenMountain was chosen.
It's built on top of IceLink (WebRTC for all Browsers and Native Platforms by FrozenMountain) and
WebSync (Signaling, Chat & Data Synchronization by FrozenMountain) with the ability for multi-party conferencing (SFU & MCU).
FrozenMountain enables us to use use state of the art codecs like VP8 and VP9.
The project was designed to run on Unity (Android and iOS), as well as WPF.
There are other platforms, which could easily be targeted.
E.g. macOS, tvOS, Linux, UWP (Hololens!), iOS and Android both native and Xamarin, all browsers.
Why WebRTC
WebRTC (Web Real-Time Communication) is a free, open-source project that provides web browsers and mobile applications with real-time communication (RTC) […].
It allows audio and video communication to work inside web pages [and apps] by allowing direct peer-to-peer communication […].
FrozenMountain supports many platforms for IceLink, WebSync and LiveSwitch. There are also libraries for Unity3D. But at the moment FrozenMountain does not provide us with sources and sinks for audio nor video. You also need to get the Unity3D specific usage of the hardware powered codecs to work. So you have to do all on your own, without help from FrozenMountain (if you don't pay for professional services). It was a long and stony path we had to go. But in the end, it's working.
We managed to implement audio source and sink platform agnostic, so we can use it for every platform the magic of C# and .NET runs on. The video sinks and sources use hardware encoder and need a codec for each platform (platform specific workload). This way of implementing WebRTC on Unity3D can be used for LiveSwitch and also for IceLink.
Some very time consuming bugs
Could not initialize VPX encoder. ABI version mismatch -> wrong VP8/VP9 encoder version
Could not initialize VPX encoder. Invalid parameter -> wrong initilization params for encoder
Source Code
We would like to give back to the community. This implementation was done during a bigger project, so the source code can't be shared. But you can reach out to us, if you need a hand.
araucon GmbH Terms of Service and Privacy Policy
1. Terms
By accessing the website at http://www.auerflorian.com, you are agreeing to be bound by these terms of service, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this website are protected by applicable copyright and trademark law.
2. Use License
Permission is granted to temporarily download one copy of the materials (information or software) on araucon GmbH's website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not:
modify or copy the materials;
use the materials for any commercial purpose, or for any public display (commercial or non-commercial);
attempt to decompile or reverse engineer any software contained on araucon GmbH's website;
remove any copyright or other proprietary notations from the materials; or
transfer the materials to another person or "mirror" the materials on any other server.
This license shall automatically terminate if you violate any of these restrictions and may be terminated by araucon GmbH at any time. Upon terminating your viewing of these materials or upon the termination of this license, you must destroy any downloaded materials in your possession whether in electronic or printed format.
3. Disclaimer
The materials on araucon GmbH's website are provided on an 'as is' basis. araucon GmbH makes no warranties, expressed or implied, and hereby disclaims and negates all other warranties including, without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights.
Further, araucon GmbH does not warrant or make any representations concerning the accuracy, likely results, or reliability of the use of the materials on its website or otherwise relating to such materials or on any sites linked to this site.
4. Limitations
In no event shall araucon GmbH or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use the materials on araucon GmbH's website, even if araucon GmbH or a araucon GmbH authorized representative has been notified orally or in writing of the possibility of such damage. Because some jurisdictions do not allow limitations on implied warranties, or limitations of liability for consequential or incidental damages, these limitations may not apply to you.
5. Accuracy of materials
The materials appearing on araucon GmbH's website could include technical, typographical, or photographic errors. araucon GmbH does not warrant that any of the materials on its website are accurate, complete or current. araucon GmbH may make changes to the materials contained on its website at any time without notice. However araucon GmbH does not make any commitment to update the materials.
6. Links
araucon GmbH has not reviewed all of the sites linked to its website and is not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by araucon GmbH of the site. Use of any such linked website is at the user's own risk.
7. Modifications
araucon GmbH may revise these terms of service for its website at any time without notice. By using this website you are agreeing to be bound by the then current version of these terms of service.
8. Governing Law
These terms and conditions are governed by and construed in accordance with the laws of Germany, Bavaria and you irrevocably submit to the exclusive jurisdiction of the courts in that State or location.
Privacy Policy
Your privacy is important to us.
It is araucon GmbH's policy to respect your privacy regarding any information we may collect while operating our website. Accordingly, we have developed this privacy policy in order for you to understand how we collect, use, communicate, disclose and otherwise make use of personal information. We have outlined our privacy policy below.
We will collect personal information by lawful and fair means and, where appropriate, with the knowledge or consent of the individual concerned.
Before or at the time of collecting personal information, we will identify the purposes for which information is being collected.
We will collect and use personal information solely for fulfilling those purposes specified by us and for other ancillary purposes, unless we obtain the consent of the individual concerned or as required by law.
Personal data should be relevant to the purposes for which it is to be used, and, to the extent necessary for those purposes, should be accurate, complete, and up-to-date.
We will protect personal information by using reasonable security safeguards against loss or theft, as well as unauthorized access, disclosure, copying, use or modification.
We will make readily available to customers information about our policies and practices relating to the management of personal information.
We will only retain personal information for as long as necessary for the fulfilment of those purposes.
We are committed to conducting our business in accordance with these principles in order to ensure that the confidentiality of personal information is protected and maintained. araucon GmbH may change this privacy policy from time to time at araucon GmbH's sole discretion.
Name und Sitz des Versicherers:
exali AG
Franz-Kobinger-Str. 9
86157 Augsburg
Redaktionell verantwortlich
Florian Auer,
Blasius-Hogger-Weg 4,
83404 Ainring
EU-Streitschlichtung
Die Europäische Kommission stellt eine Plattform zur Online-Streitbeilegung (OS) bereit: https://ec.europa.eu/consumers/odr/. Unsere E-Mail-Adresse finden Sie oben im Impressum.