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

音视频不同步,急求解决方案! #413

Open
saysmy opened this issue Jan 3, 2019 · 8 comments
Open

音视频不同步,急求解决方案! #413

saysmy opened this issue Jan 3, 2019 · 8 comments

Comments

@saysmy
Copy link

saysmy commented Jan 3, 2019

代码配置:

flvPlayer = flvjs.createPlayer({
                type: 'flv',
                isLive: true,
                hasAudio: true,
                hasVideo: true,
                url: 'http://xxx.flv'
            });

尝试过以下方案:

  1. fixAudioTimestampGap设置为false
  2. enableStashBuffer设置false
  3. 使用commit (2edad7f)方案

控制台输出:
[MSEController] > Received Initialization Segment, mimeType: audio/mp4;codecs=mp4a.40.2 flv.js:11675 [MSEController] > Received Initialization Segment, mimeType: video/mp4;codecs=avc1.640029

chrome://media-internals/ log:
image

LFLiveKit 的音频流时间戳问题,定期会有两帧之间存在两倍时间戳差,会导致严重音画不同步。
可以关掉 config.fixAudioTimestampGap 选项,禁用该 workaround 后不再会有大量 warning,但一样会不同步。

这个音频不规范,请问如何优化解决呢?推流端应该做什么样的优化

还有没有其他的解决方案呢?
现在有的主播播放四五分钟便开始严重音画不同步,有的播放二三十分钟画面相比音频稍有延迟

@saysmy
Copy link
Author

saysmy commented Jan 3, 2019

目前用的是腾讯云的推流sdk

@saysmy
Copy link
Author

saysmy commented Jan 4, 2019

今天试了下,播放了几十个例子,#354 这个pr的确没出现不同步的情况,是可以用的!

@PlutoCA
Copy link

PlutoCA commented Apr 28, 2019

你好,请问是怎么解决的,怎么切到 #354 这个pr 的代码

@saysmy
Copy link
Author

saysmy commented Apr 29, 2019

@PlutoCA 我上传了一份源代码 pr354 你可以直接用,这个用了两个多月,运行了几百个主播是没问题的

@PlutoCA
Copy link

PlutoCA commented Apr 29, 2019

ok 👌

@Jasminff
Copy link

@PlutoCA ,您好,请问能支持ie浏览器吗

@PlutoCA
Copy link

PlutoCA commented Jun 13, 2019

@PlutoCA ,您好,请问能支持ie浏览器吗

不支持的噢,IE 要用flash ,推荐用video.js

@tangshanghai
Copy link

@saysmy 感谢,解决了我一大难题

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

4 participants