samirkumardas / jmuxer

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

unknown configuration problem when feeding single frame packet #153

Open LineCatOvO opened 3 months ago

LineCatOvO commented 3 months ago

There is a server(c using ffmpeg) and a client(JMuxer in html page), server sends the encoded single frame's packet to the client using websocket, I have configured the client JMuxer:

let jmuxer = new JMuxer({
        node:"videoObject",
        mode:'video',
        debug:true,
        fps:60,
        flushingTime:0,
});

and the feed function:

jmuxer.feed({
        video:raw,
        //duration:0
        //render immediately once received
    })

then while in console the frames received, (each two line means a frame?)

jmuxer: No. of frames of the last chunk: 1 jmuxer.js:271:14
put segment (video): dts: 7008 frames: 1 second: 00:07 jmuxer.js:271:14
jmuxer: No. of frames of the last chunk: 1 jmuxer.js:271:14
put segment (video): dts: 7024 frames: 1 second: 00:07 jmuxer.js:271:14
jmuxer: No. of frames of the last chunk: 1 jmuxer.js:271:14
put segment (video): dts: 7040 frames: 1 second: 00:07 jmuxer.js:271:14
jmuxer: No. of frames of the last chunk: 1 jmuxer.js:271:14
put segment (video): dts: 7056 frames: 1 second: 00:07 jmuxer.js:271:14
jmuxer: No. of frames of the last chunk: 1 jmuxer.js:271:14
put segment (video): dts: 7072 frames: 1 second: 00:07 jmuxer.js:271:14
jmuxer: No. of frames of the last chunk: 1 jmuxer.js:271:14
put segment (video): dts: 7088 frames: 1 second: 00:07 jmuxer.js:271:14

(dts increasing speed in console message is about 1000/~3s, while in server I have set the pts and dts increasing as 60fps, performance issue?) the video play is more like 1 fps and if I set the duration too low(16, which is the 60fps), its decode goes error. I think there should be something I didn't configured correctly, but after hours I have completely no idea, much thanks if you can help me.

Laur-lct commented 3 weeks ago

I have encountered a similar problem with a live-streaming setup like yours. It happens in Chrome. If I click anywhere on the opened browser client page or open and close the developer tools in the browser, the rendering speeds up to the expected rate. I have not found the root cause yet, only this strange observation