samirkumardas / jmuxer

jMuxer - a simple javascript mp4 muxer that works in both browser and node environment.
Other
559 stars 114 forks source link

Live Streaming #112

Open krauthaufen opened 2 years ago

krauthaufen commented 2 years ago

Hey, I'm using JMuxer for live-streaming rendered images from a server and it works pretty well so far. To be clear: I'm controlling the camera/etc. on the client, render images on a server, encode them and send them back to the client via a WebSocket. When running locally on a Google Chrome I end up having about 10-80ms delay between inputs and a new video-frame which is totally acceptable for my application.

However I have some compatibility problems I can't solve:

  1. Firefox seems to buffer 1s of video before it starts playing (the delay decreases over some time)
  2. In some scenarios (pausing JS in the debugger, etc.) it sometimes"accumulates" a frame-delay that I can't remove via setting currentTime

The options I'm using are:

jmuxer = new JMuxer({
    node: 'player',
    mode: 'video', 
    debug: false,
    flushingTime: 0,
    clearBuffer: true,
    maxDelay: 0.05,
    fps: 60
});

Can anyone help me here?

m0rt3nlund commented 9 months ago

I have the same problem and ended up with setting up an interval that called cancelDelay function.. Works, but I do not think this is ideal.. Would be happy to see another way to do it! :)