Open nihalar opened 2 months ago
Were you able to figure this out? @nihalar
Were you able to figure this out? @nihalar
Hey, I was able to figure this out. I'm not sure why but I had the same issue where in the console it only logs that I receive one frame, but I was actually receiving all of the frames. The issue was that I was pointing my camera at the wrong side of the 3D Object so I couldn't see the feed, had to rotate my 3d object by 180 degrees and it fixed it lol... hopefully you have the same issue
I'm not sure, but it may be possible that you need to call WebRTC.Update inside the OnTrack event. Try this:
_peerConnection.OnTrack = e =>
{
if (e.Track is VideoStreamTrack track)
{
track.OnVideoReceived += tex =>
{
Debug.Log("Video Received");
_receiveImage.texture = tex;
};
if (!videoUpdateStarted)
{
StartCoroutine(WebRTC.Update());
videoUpdateStarted = true;
}
}
};
Package version
3.0.0-pre.7
Environment
Steps To Reproduce
I have both server and client running in unity. The server creates a Video Stream like this:
The client tries to read the video stream. But only the ontrack is called only once. var config = GetRTCConfiguration(); _peerConnection = new RTCPeerConnection(ref config); _peerConnection.OnIceCandidate += OnIceCandidate; _peerConnection.OnConnectionStateChange += OnConnectionStateChange; //_peerConnection.OnTrack += OnTrack;
"Video Received" Log is printed just once. I was expecting it to print every frame. Can someone direct me the problem?
Current Behavior
No response
Expected Behavior
No response
Anything else?
No response