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

Clarification needed for handling raw AAC bitstreams without description #832

Open
ChunMinChang opened this issue Sep 9, 2024 · 2 comments

Comments

@ChunMinChang
Copy link
Member

ChunMinChang commented Sep 9, 2024

According to the AAC registration in WebCodecs, when the description is not present in AudioDecoderConfig, the bitstream is assumed to be in ADTS format. Otherwise, it's assumed to be in AAC. However, there's a case (https://webvideo-js.pages.dev/) where raw AAC data is provided to the audio decoder without supplying description data in configure beforehand (#826 seems a similar issue for opus).

Currently, Chrome can decode this raw AAC data, and Firefox has patches to support this behavior as well (by generating a AudioSpecificConfig).

This issue can be easily reproduced by adding a test case in audioDecoder-codec-specific.https.any.js WPT that replicates the properties of MP4_AAC_DATA but omits the description. I would like to ask if this behavior should be officially mentioned or detailed in the WebCodecs spec. If this use case is something that should be supported, it might be worthwhile to include a corresponding WPT for this scenario.

@ChunMinChang ChunMinChang changed the title Clarification needed for handling AAC bitstreams without description Clarification needed for handling raw AAC bitstreams without description Sep 9, 2024
@dalecurtis
Copy link
Contributor

Hmm, Chromium doesn't intentionally generate an audio specific config AFAIK. FFmpeg may be doing something under the hood though -- I doubt this works if we end up having to use a platform decoder. I don't know enough about AAC to say if there are forms where AAC can be decoded w/o the ASC.

@padenot
Copy link
Collaborator

padenot commented Sep 10, 2024

I don't know enough about AAC to say if there are forms where AAC can be decoded w/o the ASC.

Very often you can make a good guess if you have the channel count / sample rate, and get something to decode fine by generating extradata. For example, here's some code that does it: https://searchfox.org/mozilla-central/source/dom/media/platforms/agnostic/bytestreams/Adts.cpp#273-287.

Related: #826 (comment)

moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 3, 2024
Due to the ongoing discussion in issue 832 [1], which has not yet
reached a consensus among all parties, the AAC-without-description WPT
introduced in the previous patch should be relocated to the *mozilla*
folder under WPT. This ensures that the test remains specific to Mozilla
and avoids unintentionally causing failures in other browers' test
suites.

[1] w3c/webcodecs#832

Differential Revision: https://phabricator.services.mozilla.com/D222712

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1917721
gecko-commit: c81481c06eac3165b72e7bb2c3040a48b3994a0a
gecko-reviewers: media-playback-reviewers, padenot
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 4, 2024
…edia-playback-reviewers,padenot

Due to the ongoing discussion in issue 832 [1], which has not yet
reached a consensus among all parties, the AAC-without-description WPT
introduced in the previous patch should be relocated to the *mozilla*
folder under WPT. This ensures that the test remains specific to Mozilla
and avoids unintentionally causing failures in other browers' test
suites.

[1] w3c/webcodecs#832

Differential Revision: https://phabricator.services.mozilla.com/D222712
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 4, 2024
Due to the ongoing discussion in issue 832 [1], which has not yet
reached a consensus among all parties, the AAC-without-description WPT
introduced in the previous patch should be relocated to the *mozilla*
folder under WPT. This ensures that the test remains specific to Mozilla
and avoids unintentionally causing failures in other browers' test
suites.

[1] w3c/webcodecs#832

Differential Revision: https://phabricator.services.mozilla.com/D222712

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1917721
gecko-commit: c81481c06eac3165b72e7bb2c3040a48b3994a0a
gecko-reviewers: media-playback-reviewers, padenot
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 9, 2024
…edia-playback-reviewers,padenot

Due to the ongoing discussion in issue 832 [1], which has not yet
reached a consensus among all parties, the AAC-without-description WPT
introduced in the previous patch should be relocated to the *mozilla*
folder under WPT. This ensures that the test remains specific to Mozilla
and avoids unintentionally causing failures in other browers' test
suites.

[1] w3c/webcodecs#832

Differential Revision: https://phabricator.services.mozilla.com/D222712

UltraBlame original commit: c81481c06eac3165b72e7bb2c3040a48b3994a0a
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 9, 2024
…edia-playback-reviewers,padenot

Due to the ongoing discussion in issue 832 [1], which has not yet
reached a consensus among all parties, the AAC-without-description WPT
introduced in the previous patch should be relocated to the *mozilla*
folder under WPT. This ensures that the test remains specific to Mozilla
and avoids unintentionally causing failures in other browers' test
suites.

[1] w3c/webcodecs#832

Differential Revision: https://phabricator.services.mozilla.com/D222712

UltraBlame original commit: c81481c06eac3165b72e7bb2c3040a48b3994a0a
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this issue Oct 10, 2024
…edia-playback-reviewers,padenot

Due to the ongoing discussion in issue 832 [1], which has not yet
reached a consensus among all parties, the AAC-without-description WPT
introduced in the previous patch should be relocated to the *mozilla*
folder under WPT. This ensures that the test remains specific to Mozilla
and avoids unintentionally causing failures in other browers' test
suites.

[1] w3c/webcodecs#832

Differential Revision: https://phabricator.services.mozilla.com/D222712
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants