obs-webrtc: Add AAC Support
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:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.
Thanks for your contribution. There are some formal issues.
- Please fill the template, especially motivation and tests.
- Also run clang-format on your code.
- your commit has no message. A description is mandatory.
In particular, tests with our various aac encoders would be useful:
- FFmpeg aac
- coreaudio
- fdk-aac
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:
D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(142,17): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj] D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(142,17): error C2220: the following warning is treated as an error [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj] D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(264,4): error C2065: 'RTC_CODEC_AAC': undeclared identifier [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj] D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(271,17): error C2078: too many initializers [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj] D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(275,3): error C3861: 'rtcSetAACPacketizationHandler': identifier not found [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj]
Requires libdatachannel 0.19.0 stable release
Requires libdatachannel 0.19.0 stable release
ah, aac was added to libdatachannel on august 23 indeed by the same author. @troman123 if you want to pass CI, you'll have to point build-spec.json to your fork of obs-deps which incorporate the update of libdatachannel to 0.19 stable release (in a separate commit which will be dropped upon eventual merge) I'd suggest you also PR the libdatachannel update to obs-deps. Also, for flatpak, you'll have to have a commit to point to 0.19 stable.
@pkviet , thanks for your suggestion, i will follow those steps to fix
@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. It's not in mergeable state otherwise.
windows CI doesn't pass either:
D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(142,17): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj] D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(142,17): error C2220: the following warning is treated as an error [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj] D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(264,4): error C2065: 'RTC_CODEC_AAC': undeclared identifier [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj] D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(271,17): error C2078: too many initializers [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj] D:\a\obs-studio\obs-studio\plugins\obs-webrtc\whip-output.cpp(275,3): error C3861: 'rtcSetAACPacketizationHandler': identifier not found [D:\a\obs-studio\obs-studio\build_x64\plugins\obs-webrtc\obs-webrtc.vcxproj]
fixed
Thanks for your contribution. There are some formal issues.
- Please fill the template, especially motivation and tests.
- Also run clang-format on your code.
- your commit has no message. A description is mandatory.
In particular, tests with our various aac encoders would be useful:
- FFmpeg aac
- coreaudio
- fdk-aac
You'll also have to fix the CI issues. Check the CI logs ; seems flatpak and macos do not build.
done
@troman123 Would you mind rebasing this PR? Master now has the obs-deps you need!
@troman123 Would you mind rebasing this PR? Master now has the obs-deps you need!
Sorry, the pr conflict has been resolved now.
@Sean-Der @RytoEX
Tested on MacOS and works. (FFmpeg AAC / CoreAudio AAC) More, WHIP HEVC #10159 has been tested and works. (Apple VT HEVC Hardware Encoder)
@Sean-Der @RytoEX I have rebased the master. can be ready for merging now. thank you.