-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
obs-webrtc: Add AAC Support #9567
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
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution. There are some formal issues.
In particular, tests with our various aac encoders would be useful:
You'll also have to fix the CI issues. Check the CI logs ; seems flatpak and macos do not build. |
windows CI doesn't pass either: |
Requires libdatachannel 0.19.0 stable release |
ah, aac was added to libdatachannel on august 23 indeed by the same author. |
@pkviet , thanks for your suggestion, i will follow those steps to fix |
Also fill the template and fix the commit message, as I pointed earlier. |
db3d477
to
fe69dc1
Compare
fixed |
done |
@troman123 Would you mind rebasing this PR? Master now has the obs-deps you need! |
according to rfc6416, This adds AAC support to obs-webrtc Signed-off-by: troman <[email protected]>
Sorry, the pr conflict has been resolved now. |
Tested on MacOS and works. (FFmpeg AAC / CoreAudio AAC) ![]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick scan. I might need someone else who understands WebRTC/WHIP to clarify and clean up the code comments.
|
||
if (is_aac) { | ||
/* | ||
// Latm to write, StreamMuxConfig:out of band | ||
// RFC6416 6.3. Fragmentation of MPEG-4 Audio Bitstream (p17) | ||
// It is RECOMMENDED to put one audioMuxElement in each RTP packet. If | ||
// the size of an audioMuxElement can be kept small enough that the size | ||
// of the RTP packet containing it does not exceed the size of the Path | ||
// MTU, this will be no problem. | ||
// in this case , PayloadLengthInfo will not be writen in rtp payload. | ||
|
||
uint8_t buf[1200] = {0}; | ||
// PayloadLengthInfo() | ||
int header_size = packet->size/0xFF + 1; | ||
memset(buf, 0xFF, header_size - 1); | ||
buf[header_size - 1] = packet->size % 0xFF; | ||
|
||
//PayloadMux | ||
memcpy(buf + header_size, packet->data, packet->size); | ||
|
||
Send(buf, header_size + packet->size, duration, audio_track); | ||
*/ | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this just adding a large comment block?
@@ -1,6 +1,5 @@ | |||
#include "whip-output.h" | |||
#include "whip-utils.h" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove this line.
if (object_type == 5 /*AOT_SBR*/ | ||
|| (object_type == 29 /*AOT_PS*/ && | ||
!(show_bits(&gb, 3) & 0x03 && !(show_bits(&gb, 9) & 0x3F)))) { | ||
if (object_type == 29 /*AOT_PS*/) | ||
ps = 1; | ||
ext_object_type = 5 /*AOT_SBR*/; | ||
sbr = 1; | ||
|
||
ext_sample_rate = get_sample_rate(&gb, &ext_sampling_index); | ||
object_type = get_object_type(&gb); | ||
if (object_type == 22 /*AOT_ER_BSAC*/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather see these object_type
values as an enum.
} | ||
specific_config_bitindex = gb.bit_index; | ||
|
||
//no support AOT_ALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//no support AOT_ALS | |
// no support AOT_ALS |
Sorry I didn't look at this sooner! Would it be possible to put non-OBS specific code upstream? Other projects could benefit from this, and want to keep the OBS+WebRTC code maintainable. I am 100% in support of AAC though. Anything that makes it easier for users. |
Description
according to rfc6416, This adds AAC support to obs-webrtc
https://datatracker.ietf.org/doc/rfc6416/
Motivation and Context
My motivation is to support RTP AAC in WebRTC according to RFC-6416.
How Has This Been Tested?
All testing during development was performed on macos-13.5.1 (22G90).
used aac encoder:
FFmpeg aac
coreaudio aac
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: