0

I ran websock to receive fmp4 video stream(no audio data),and append segment to sourceBuffer,the video(25fps) is pull from rtsp media server,and be converted to fragment mp4 via ffmpeg api. When mse player raise 'play' event,i set video currentTime to the latest buffer timestamp via sourceBuffer.buffered.Such as the current sourceBuffer.buffered.end(0) is equal 100.0,and i set video currentTime to 100.0,it can run normally,but while i debug on setinterval per second, it show it about these "current time = 2224.166326, sourceBuffer.buffered.end = 2224.24","current time = 2269.164432, sourceBuffer.buffered.end = 2269.24".the currentTime is always slow about 80ms(2 frames duration),and the picture show on player is also slow about 80ms. I want play the video as fast as sourceBuffer.buffered.end. Anyone help? Thanks;

if (this.sourceBuffer && this.sourceBuffer.buffered.length) {
            var end = this.sourceBuffer.buffered.end(0);
            this.video.currentTime = end;
        }
4

0 回答 0