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

RTC: Refine FFmpeg opus audio noisy issue. v5.0.197 v6.0.97 #3852

Merged
merged 6 commits into from
Nov 4, 2023

Conversation

chundonglinlin
Copy link
Member

@chundonglinlin chundonglinlin commented Oct 27, 2023

Description

When converting between AAC and Opus formats (aac2opus or opus2aac), the av_frame_get_buffer API is frequently called.

Objective

The goal is to optimize the code logic and reduce the frequent allocation and deallocation of memory.

In the case of aac2opus, av_frame_get_buffer is still frequently called.
In the case of opus2aac, the goal is to avoid calling av_frame_get_buffer and reduce memory allocations.

Additional Note

Before calling the av_audio_fifo_read API, use av_frame_make_writable to check if the frame is writable. If it is not writable, create a new frame.


TRANS_BY_GPT4


Co-authored-by: john hondaxiao@tencent.com

@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Oct 27, 2023
@chundonglinlin chundonglinlin changed the title RTC: Refine FFmpeg opus audio noisy issue.(#3845) RTC: Refine FFmpeg opus audio noisy issue. Oct 27, 2023
@winlinvip
Copy link
Member

winlinvip commented Oct 27, 2023

Why should we make this change? What problems might arise? What issues does it solve?

TRANS_BY_GPT4

@winlinvip winlinvip changed the title RTC: Refine FFmpeg opus audio noisy issue. RTC: Refine FFmpeg opus audio noisy issue. v5.0.197 v6.0.97 Nov 4, 2023
@winlinvip winlinvip added the RefinedByAI Refined by AI/GPT. label Nov 4, 2023
@winlinvip winlinvip merged commit e7b629c into ossrs:develop Nov 4, 2023
17 checks passed
winlinvip pushed a commit that referenced this pull request Nov 4, 2023
When converting between AAC and Opus formats (aac2opus or opus2aac), the
`av_frame_get_buffer` API is frequently called.

The goal is to optimize the code logic and reduce the frequent
allocation and deallocation of memory.

In the case of aac2opus, av_frame_get_buffer is still frequently called.
In the case of opus2aac, the goal is to avoid calling
av_frame_get_buffer and reduce memory allocations.

Before calling the `av_audio_fifo_read` API, use
`av_frame_make_writable` to check if the frame is writable. If it is not
writable, create a new frame.

---------

Co-authored-by: john <hondaxiao@tencent.com>
duiniuluantanqin pushed a commit to duiniuluantanqin/srs that referenced this pull request Nov 16, 2023
When converting between AAC and Opus formats (aac2opus or opus2aac), the
`av_frame_get_buffer` API is frequently called.

The goal is to optimize the code logic and reduce the frequent
allocation and deallocation of memory.

In the case of aac2opus, av_frame_get_buffer is still frequently called.
In the case of opus2aac, the goal is to avoid calling
av_frame_get_buffer and reduce memory allocations.

Before calling the `av_audio_fifo_read` API, use
`av_frame_make_writable` to check if the frame is writable. If it is not
writable, create a new frame.

---------

Co-authored-by: john <hondaxiao@tencent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RefinedByAI Refined by AI/GPT. TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants