WebRTC-for-Unity | WebRTC for Unity | Game Engine library
kandi X-RAY | WebRTC-for-Unity Summary
kandi X-RAY | WebRTC-for-Unity Summary
WebRTC for Unity (BROKEN, NOT WORKING, DO NOT USE)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of WebRTC-for-Unity
WebRTC-for-Unity Key Features
WebRTC-for-Unity Examples and Code Snippets
Community Discussions
Trending Discussions on WebRTC-for-Unity
QUESTION
I'm trying to bridge between Unity and WebRTC.
Update: Alright, I created a repo for this, still experiencing weird artifacts with rendering the textures, which I can't figure out the reason why. If anyone wants to take a look.
Since WebRTC is capable of providing frames from VideoTracks as a texture, I thought it would be best if it shares the EGL context with unity, so I can render it directly into the engine.
I figured that would be by setting the video hardware acceleration options on the PeerConnectionFactory. as follows:
...ANSWER
Answered 2017-Aug-21 at 16:51So the trick is to use GLES 2 because that's what EGLBase is doing (for now, let's see if it gets updated in the official repo)
Also the unity context needs to be aquired correctly, and used as the sharing context, to be able to pass textures.
Finally, the texture needs to be rendered with a special GLSL shader, and the texture to be treated as a samplerExternalOES (similar to Hidden/VideoDecodeAndroid shader). One could render it to a RenderTexture using this shader, and then use whatever material/shader to render that texture on the scene.
A working demo is here https://github.com/iBicha/WebRTC-for-Unity/
QUESTION
I found the answer to how to do it natively here but Im running Unity.
How to take picture with camera using ARCore
I'm not sure how to access the Unity surface renderer thread to be able to drop in those functions.
This looks like a good start. Ideas?
Edit:
Using Texture2d ReadPixels or ScreenCapture.CaptureScrenshot are not viable as they are blocking the render thread. The code below is enough to block the thread.
...ANSWER
Answered 2018-Feb-27 at 19:20Are you looking to learn how to do it? If you are just looking to capture a screenshot - it is built into Unity. See https://docs.unity3d.com/ScriptReference/Application.CaptureScreenshot.html
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install WebRTC-for-Unity
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page