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

Videostream not displaying in chrome #42

Open
CodingSaturn opened this issue Jan 12, 2021 · 0 comments
Open

Videostream not displaying in chrome #42

CodingSaturn opened this issue Jan 12, 2021 · 0 comments

Comments

@CodingSaturn
Copy link

Hey everyone,

for a project my goal was to livestream a video from a pipeline defined using gstreamer to the browser. I don't have prior experience with webrtc but the video-compositing example made me achieve streaming the following video to the browser. I only changed a view lines to make this work.

const gstreamer = require("gstreamer-superficial");
const { RTCVideoSource } = require('wrtc').nonstandard;

let numOfClients = 0
let pipeline = null

function beforeOffer(peerConnection) {
  if (numOfClients == 0) {
    console.log("starting new pipeline");
    pipeline = new gstreamer.Pipeline("videotestsrc is-live=True ! videoconvert ! videoscale ! clockoverlay shaded-background=true ! video/x-raw,format=I420,width=1024,height=576,framerate=25/1 ! appsink name=sink");
  }
  numOfClients++;
  console.log("new peer connected");
  console.log(numOfClients, "Clients connected");
  const appsink = pipeline.findChild('sink');
  const source = new RTCVideoSource();
  const track = source.createTrack();
  peerConnection.addTransceiver(track);

When testing in firefox everything works fine and the videoframes get displayed correctly. However when I visit the same page on chrome it doesn't work and there are no error messages. Therefore I don't know if it is a problem with my addition or something about node-webrtc that isn't working correctly.

The only thing I could think of was printing the MediaStreamObject to the console and it looks the same in firefox and chromium (only values filled there are an 'id' and a boolean named 'active' set to true, 'onaddtrack' and 'onremovetrack' are both null. Chrome also prints two other values which firefox doesn't display which are 'onactive' and 'oninactive' both set to null, which firefox doesn't show)

The version I tested this on were:

  • Chrome version: Chromium 80.0.3987.162
  • Firefox version: Mozilla Firefox 68.9.0esr

I also asked the question on stackoverflow but as I don't get any error messages in the browser my hopes aren't too high that someone knows what the problem is. Anyway you can find it here.

Thanks in advance!

(PS: I saw question #41, which could be the same problem as I am experiencing but I am not sure, so I wanted to open an additional issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant