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

use a new silent frame insert algorithm for audio remux #354

Merged
merged 11 commits into from
Apr 28, 2021

Conversation

jamken
Copy link
Contributor

@jamken jamken commented Jul 27, 2018

the old algorithm cannot cover some common situation, like:

  1. audio frame dts does not increase by a standard duration, sometimes it increase for a large duration(more than 1.5 * refSampleDuration), sometimes it increase for a small duration. But the average duration is more or less to refSampleDuration. the old algorithm would insert silent frames which result into video/audio unsync.
  2. for network living stream, because of network jitter or frame lost, the encoder would generate the audio frames whose dts is not correct. but if the gap between two adjacent frame is not over 1.5 * refSampleDuration and the accumulate gap would become larger and larger. the old algorithm never insert silent frames for this case.

jamken and others added 9 commits July 8, 2018 12:58
the old algorithm cannot cover some common situation, like:
1. audio frame dts does not increase by a standard duration, sometimes it increase for a large duration(more than 1.5 * refSampleDuration), sometimes it increase for a small duration. But the average duration is more or less to refSampleDuration. the old algorithm would insert silent frames which result into video/audio unsync.
2. for network living stream, because of network jitter or frame lost, the encoder would generate the audio frames whose dts is not correct. but if the gap between two adjacent frame is not over 1.5 * refSampleDuration and the accumulate gap would become larger and larger. the old algorithm never insert silent frames for this case.
@saysmy
Copy link

saysmy commented Jan 5, 2019

已测试我们平台不同时长的数十个直播流,均正常!没有音画不同步现象,推荐!

@x-ray-s
Copy link

x-ray-s commented Jun 3, 2020

Please keep up with code style, and remove invalid code modify.

@lynxerzhang
Copy link

awesome, but after merge “flv.js master“, there was a conflict (mp4-remuxer.js), could you merge it

roackb2 pushed a commit to roackb2/flv.js that referenced this pull request Aug 9, 2020
@xqq xqq self-assigned this Apr 18, 2021
@xqq xqq merged commit 26d00d9 into bilibili:master Apr 28, 2021
@xqq
Copy link
Contributor

xqq commented Apr 28, 2021

Merged, thanks!

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

Successfully merging this pull request may close these issues.

None yet

6 participants