Page 1 of 1

Disabling AAC audio while still allowing H.264(AVC) video

PostPosted: Mon Feb 01, 2021 9:32 am
by stevensnow
For a windows only project I'm working on, we've enabled proprietary codecs as part of a feature, which has worked fine thus far. However, due to a licensing concern, we've been asked to try to disable AAC audio somehow while simultaneously still supporting H.264 video, the desired end result being H.264 video still working, but without the AAC audio working. This is only even on the table due to audio being unimportant within the context of our app.

Does anyone know if this is doable?
I suspect that with AAC audio disabled, that such a video (like an mp4 video composed of H.264 video and AAC audio) would simply not be playable.

As far as how to try this, it seems that the best way would be to rebuild ffmpeg with AAC removed for Chrome branding (within the context of custom building CEF).
Any tips on how else this could be accomplished are appreciated as well.

Thanks in advance!

Re: Disabling AAC audio while still allowing H.264(AVC) vide

PostPosted: Mon Feb 01, 2021 11:53 am
by ndesktop
If calling SetAudioMuted from CEF for each audio element (using a visitor for html media elements) is not an option, I'd try to take a look here first.
Then (wild guesses follows, since I never did this):
- patch AAC class to play nothing
- patch HTMLMediaElement and provide a some kind of "null" AudioSourceProvider, AudioSourceProviderClient.

Re: Disabling AAC audio while still allowing H.264(AVC) vide

PostPosted: Wed Feb 03, 2021 1:19 pm
by stevensnow
We were able to accomplish this with a modified version of the SetAudioMuted approach.

We use CefSharp as a wrapper for CEF. On browser initialization, we were able to access the ChromiumWebBrowser's CefBrowserHost and call SetAudioMuted(true) on it.