Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Client side is not receiving Video Frames #1072

Open
nihalar opened this issue Dec 10, 2024 · 0 comments
Open

[BUG]: Client side is not receiving Video Frames #1072

nihalar opened this issue Dec 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@nihalar
Copy link

nihalar commented Dec 10, 2024

Package version

3.0.0-pre.7

Environment

* OS:Windows 11
* Unity version: 2023.2

Steps To Reproduce

I have both server and client running in unity.
The server creates a Video Stream like this:

    _peerConnection = new RTCPeerConnection(ref config);
    _peerConnection.OnIceCandidate += OnIceCandidate;
    _peerConnection.OnIceConnectionChange += OnIceConnectionChange;
    _peerConnection.OnConnectionStateChange += OnConnectionStateChange;

    _localVideoTrack = _mainCamera.CaptureStreamTrack(1280,720);
    var sendStream = new MediaStream();
    _peerConnection.AddTrack(_localVideoTrack, sendStream);

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;

    _peerConnection.OnTrack = e =>
    {
        if (e.Track is VideoStreamTrack track)
        {
            track.OnVideoReceived += tex =>
            {
                Debug.Log("Video Received");
                _receiveImage.texture = tex;
            };
        }
    };

"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

@nihalar nihalar added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants