obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

obs-webrtc: Add AAC Support

Open troman123 opened this issue 2 years ago • 14 comments

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.

troman123 avatar Sep 06 '23 08:09 troman123

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.

pkviet avatar Sep 06 '23 08:09 pkviet

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]

pkviet avatar Sep 06 '23 08:09 pkviet

Requires libdatachannel 0.19.0 stable release

tytan652 avatar Sep 06 '23 09:09 tytan652

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 avatar Sep 06 '23 09:09 pkviet

@pkviet , thanks for your suggestion, i will follow those steps to fix

troman123 avatar Sep 06 '23 09:09 troman123

@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.

pkviet avatar Sep 06 '23 09:09 pkviet

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

troman123 avatar Sep 06 '23 13:09 troman123

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 avatar Sep 07 '23 02:09 troman123

@troman123 Would you mind rebasing this PR? Master now has the obs-deps you need!

Sean-Der avatar Jan 29 '24 20:01 Sean-Der

@troman123 Would you mind rebasing this PR? Master now has the obs-deps you need!

Sorry, the pr conflict has been resolved now.

troman123 avatar May 07 '24 11:05 troman123

@Sean-Der @RytoEX

troman123 avatar May 07 '24 11:05 troman123

Tested on MacOS and works. (FFmpeg AAC / CoreAudio AAC) More, WHIP HEVC #10159 has been tested and works. (Apple VT HEVC Hardware Encoder)

image

MarcoMayCry avatar May 07 '24 12:05 MarcoMayCry

@Sean-Der @RytoEX I have rebased the master. can be ready for merging now. thank you.

troman123 avatar May 24 '24 02:05 troman123