steep-balloon-41261
04/17/2023, 9:00 PMimportant-megabyte-62876
04/17/2023, 9:02 PMimportant-megabyte-62876
04/17/2023, 9:05 PMimportant-megabyte-62876
04/17/2023, 9:27 PMdry-elephant-14928
04/17/2023, 11:10 PMimportant-megabyte-62876
04/17/2023, 11:26 PMimportant-megabyte-62876
04/17/2023, 11:29 PMimportant-megabyte-62876
04/17/2023, 11:30 PMimportant-megabyte-62876
04/17/2023, 11:32 PMdry-elephant-14928
04/18/2023, 12:52 AMimportant-megabyte-62876
04/18/2023, 12:56 AMimportant-megabyte-62876
04/18/2023, 12:58 AMboundless-energy-78552
04/18/2023, 12:44 PMboundless-energy-78552
04/18/2023, 12:45 PMimportant-megabyte-62876
04/18/2023, 6:00 PMvideo.VideoReceived
via a lambda function and only using the texture. Here is my C# code for when a track is subscribed:
private void OnTrackSubscribed(RemoteTrack track, RemoteTrackPublication publication, RemoteParticipant participant)
{
if (track.Kind == TrackKind.Video)
{
var video = track.Attach() as HTMLVideoElement;
// VideoReceived is called every time the video resolution changes
video.VideoReceived += tex =>
{
OnGotNewScreenShareVideoTexture(tex);
};
}
else if (track.Kind == TrackKind.Audio)
{
track.Attach();
Debug.Log("Got new audio track!");
}
}
// This function creates a new material with the video texture, then applies that material onto a target renderer.
private void OnGotNewScreenShareVideoTexture(Texture2D screenShareVideoTexture)
{
debugTargetRenderer.material = MaterialUtils.CreateNewMaterialUnlitMipMapBias(screenShareVideoTexture);
Debug.Log("Got new screen share video texture! ("+ screenShareVideoTexture.width + "x" + screenShareVideoTexture.height + " Format: " + screenShareVideoTexture.format.ToString() + ")");
}
boundless-energy-78552
04/18/2023, 6:03 PMboundless-energy-78552
04/18/2023, 6:03 PMimportant-megabyte-62876
04/18/2023, 6:03 PMimportant-megabyte-62876
04/18/2023, 6:04 PMimportant-megabyte-62876
04/18/2023, 6:08 PMimportant-megabyte-62876
04/19/2023, 2:47 PMboundless-energy-78552
04/19/2023, 9:22 PMfalse
.
The colors seem normal for me but I maybe need a way to change the color space depending on some conditions.
Iโm using my camera instead of screenshares but there is no difference on how I handle the texture creation on the receiving side.
On the Chrome console of the video receiver, do you see any WebGL errors or warnings?
Maybe something related to texImage2dboundless-energy-78552
04/19/2023, 9:24 PMimportant-megabyte-62876
04/19/2023, 9:57 PMHTMLVideoElement.cs
, specifically? Looks like your link didn't point me to it.
I do not see any errors or warning in the browser console on Chrome for the receiver app - only a black screen.
My app differs from the example app in that I'm:
1. Creating a new unlit material (duplicating it from an existing "template" unlit material)
2. Applying the video texture to the material
3. Applying the material to the renderer of a 3D "screen" object in my scene (not using a Raw Image
or Unity's canvas system at all).
So I would recommend trying this when attempting to reproduce the issue.
Please let me know what you find out on your Windows machine! If you still aren't able to reproduce the issue after testing on Windows via the method I described above, then I should create and send over a project with the reproducible issue for you to use in order to look into it further.dry-elephant-14928
04/19/2023, 10:06 PMlinear Is texture using linear color space?
important-megabyte-62876
04/20/2023, 4:21 PMimportant-megabyte-62876
04/20/2023, 4:22 PMimportant-megabyte-62876
04/20/2023, 4:26 PMimportant-megabyte-62876
04/20/2023, 4:39 PMboundless-energy-78552
04/20/2023, 4:39 PMimportant-megabyte-62876
04/20/2023, 4:39 PMimportant-megabyte-62876
04/20/2023, 4:39 PMboundless-energy-78552
04/20/2023, 4:39 PMboundless-energy-78552
04/20/2023, 4:39 PMimportant-megabyte-62876
04/20/2023, 4:40 PMboundless-energy-78552
04/20/2023, 4:41 PMboundless-energy-78552
04/20/2023, 4:41 PMimportant-megabyte-62876
04/20/2023, 4:41 PMboundless-energy-78552
04/20/2023, 5:38 PMtheo/blackvideo
(link)
It seems that the video does not start automatically.
Can you try it?important-megabyte-62876
04/20/2023, 5:51 PMimportant-megabyte-62876
04/20/2023, 5:51 PMlivekit-bridge.jslib
per your link and rebuild?boundless-energy-78552
04/20/2023, 5:52 PMboundless-energy-78552
04/20/2023, 6:01 PMvideo.play()
fixes the issueimportant-megabyte-62876
04/20/2023, 6:16 PMlivekit-bridge.jslib
that you provided appears to fix the issue ๐ Left side is Chrome, right side is Firefox - both working now:important-megabyte-62876
04/20/2023, 6:16 PMimportant-megabyte-62876
04/20/2023, 6:17 PMboundless-energy-78552
04/20/2023, 6:18 PMimportant-megabyte-62876
04/20/2023, 6:18 PMimportant-megabyte-62876
04/20/2023, 6:19 PMimportant-megabyte-62876
04/20/2023, 8:06 PMHTMLVideoElement.cs
. Unfortunately the result appears to be the exact same regardless of whether or not the boolean is set to true or false. Here's an image showing the "washed out" look without any changes:important-megabyte-62876
04/20/2023, 8:06 PMimportant-megabyte-62876
04/20/2023, 8:06 PMimportant-megabyte-62876
04/20/2023, 8:12 PMimportant-megabyte-62876
04/21/2023, 3:36 PMboundless-energy-78552
04/21/2023, 3:37 PMimportant-megabyte-62876
04/21/2023, 3:37 PMimportant-megabyte-62876
04/21/2023, 3:48 PMboundless-energy-78552
04/21/2023, 3:49 PMimportant-megabyte-62876
04/21/2023, 3:49 PMboundless-energy-78552
04/21/2023, 3:49 PMimportant-megabyte-62876
04/21/2023, 3:49 PMboundless-energy-78552
04/21/2023, 3:59 PMimportant-megabyte-62876
04/21/2023, 4:03 PMimportant-megabyte-62876
04/21/2023, 6:04 PMboundless-energy-78552
04/24/2023, 12:49 PMboundless-energy-78552
04/24/2023, 12:51 PMimportant-megabyte-62876
04/24/2023, 3:54 PMimportant-megabyte-62876
04/24/2023, 7:43 PMimportant-megabyte-62876
04/24/2023, 7:47 PMimportant-megabyte-62876
04/24/2023, 8:23 PMGLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, video);
to
GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.SRGB8_ALPHA8, GLctx.RGBA, GLctx.UNSIGNED_BYTE, video);
which also resulted in a large drop in performance. This appears to be the exact same change that you made in livekit-bridge.jslib
and resulting in the same exact performance issue. I don't believe a solve was ever figured out for the "Video Player WebGL" plugin and therefore the above change was never implemented in that plugin, but also the issue simply wasn't investigated further so I don't know the cause.important-megabyte-62876
04/24/2023, 8:26 PMRGBA
to SRGB8_ALPHA8
in the function GLctx.SRGB8_ALPHA8
is somehow causing a very bad drop in frame rate of the app.important-megabyte-62876
04/24/2023, 8:34 PMRGBA
to SRGB8_ALPHA8
:dry-elephant-14928
04/24/2023, 8:40 PMSRGB8_ALPHA8
isn't hardware accelerated.
I wonder if there's a way to avoid that and stick to RGBA space to begin with?boundless-energy-78552
04/24/2023, 8:46 PMimportant-megabyte-62876
04/24/2023, 8:47 PMboundless-energy-78552
04/24/2023, 9:24 PMboundless-energy-78552
04/24/2023, 9:25 PMimportant-megabyte-62876
04/24/2023, 9:25 PMboundless-energy-78552
04/24/2023, 9:26 PMimportant-megabyte-62876
04/24/2023, 9:26 PMboundless-energy-78552
04/24/2023, 9:26 PMimportant-megabyte-62876
04/24/2023, 9:28 PMboundless-energy-78552
04/24/2023, 9:29 PMimportant-megabyte-62876
04/24/2023, 9:59 PMimportant-megabyte-62876
04/24/2023, 10:59 PMimportant-megabyte-62876
04/24/2023, 11:04 PMimportant-megabyte-62876
04/24/2023, 11:09 PMimportant-megabyte-62876
04/25/2023, 7:54 PMimportant-megabyte-62876
04/25/2023, 7:54 PMboundless-energy-78552
04/25/2023, 7:54 PMboundless-energy-78552
04/25/2023, 7:55 PMboundless-energy-78552
04/25/2023, 7:55 PMimportant-megabyte-62876
04/25/2023, 7:55 PMimportant-megabyte-62876
04/25/2023, 7:55 PMimportant-megabyte-62876
04/25/2023, 7:56 PMimportant-megabyte-62876
04/25/2023, 7:56 PMboundless-energy-78552
04/25/2023, 7:56 PMboundless-energy-78552
04/25/2023, 7:57 PMimportant-megabyte-62876
04/25/2023, 7:58 PMboundless-energy-78552
04/25/2023, 7:59 PMimportant-megabyte-62876
04/25/2023, 7:59 PMboundless-energy-78552
04/25/2023, 7:59 PMimportant-megabyte-62876
04/25/2023, 8:11 PMboundless-energy-78552
04/25/2023, 8:30 PMimportant-megabyte-62876
04/25/2023, 8:30 PM