OpenVidu / openvidu

OpenVidu Platform main repository

Home Page:https://openvidu.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot get MediaStream from Electron app to browser via Openvidu media server.

duyminhnguyen97 opened this issue · comments

Hi all,
I'm currently having an issue with openvidu-browser-2.17.0.js
I'm trying to transfer a camera stream from RTSP to an Openvidu media server deployed on cloud and get the stream back on the browser.

The RTSP stream was converted into an HLS stream using FFmpeg and played using hls.js. It was captured in an video tag in HTML and I used the HTMLMediaElement.captureStream().getVideoTrack() to generate MediaStreamTrack and passed it into the videoSource property in initPublisher. This publisher part was wrapped in electron. Then, the stream was connected to our cloud Openvidu server deployed on-premises exactly like in the Docs (https://docs.openvidu.io/en/2.18.0/deployment/deploying-on-premises/). The subscriber part is a simple HTML page displayed on the browser to get the stream from the cloud server. The subscriber is responsible for creating session and generating stream from the media server when streamCreated event occurs.

The whole workflow worked nicely when we tested it with our webcam, however, when we use MediaStreamTrack of our stream video instead of webcam, the subscriber part only showed the blank video.

Does anyone know what the issue is? Thanks!

Describe the bug
Cannot get MediaStream from Electron app to browser via Openvidu media server.

Expected behavior
Receive the stream from the Electron app to browser via Openvidu media server.

Wrong current behavior
Only get blank video

Client device info (if applicable)

  • Chrome Version 91.0.4472.77 (Official Build) (64-bit) on Windows 10 Version 10.0.19042 Build 19042

Screenshots

  • The blank video in the subscriber:
    image

  • The webcam test worked fine:
    image

Additional context

  • The logs of the electron app (publisher):
    electron

  • The logs of the browser (subscriber):
    browser

Why are not using native RTSP support in OpenVidu? https://docs.openvidu.io/en/2.18.0/advanced-features/ip-cameras/

In any case, have you tested in browser? Does it work on browser and fails in electron?

@micaelgallego I used the native RTSP support in OpenVidu, however, it only worked with my local server, not the remote server. As far as I know, I cannot get the RTSP stream from outside of the local network. That's why I changed the approach to stream the video from MediaStream instead. Do you have any suggestions to work with RTSP from the remote server?
I haven't tried in the browser, but I can make a test. Nevertheless, can I stream the MediaStream from HTML to the remote OpenVidu server as I described above?