WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
260491
REGRESSION (Safari 17 beta): [MSE] Can no longer play .FLAC inside MP4
https://bugs.webkit.org/show_bug.cgi?id=260491
Summary
REGRESSION (Safari 17 beta): [MSE] Can no longer play .FLAC inside MP4
Jamie W
Reported
2023-08-21 15:19:38 PDT
(Tested on iPadOS) Before Safari 17, HTMLMediaElement and MediaSource supported the playback of FLAC audio inside an MP4 container (i.e. MediaSource.isTypeSupported('audio/mp4; codecs="flac"') == true && new Audio().canPlayType('audio/mp4; codecs="flac"') == "probably" ). In the iPadOS 17 beta, FLAC playback is no longer supported. Trying to add a SourceBuffer with the FLAC codec throws a NotSupportedException. For context, we develop a web-based application which is used by radio broadcasters and journalists to remotely access an on-premises application. A key function of our application is the ability to load and manipulate long (uncompressed) takes of audio, using the device's local storage to avoid unnecessary network requests. To achieve this, we attach a MediaSource with a FLAC codec. In Safari, we also use this as a polyfill to work around the unavailability of OPUS in iPad and macOS Safari. Save inefficently re-encoding to a lossy codec that is supported by [Managed]MediaSource, given there is no support for uncompressed audio in MediaSource, we are unable to find a way to work around this.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-08-22 12:45:36 PDT
<
rdar://problem/114276660
>
Smoley
Comment 2
2023-08-22 14:04:15 PDT
Thanks for filing, if possible please link to a test case which reproduces this issue.
Jer Noble
Comment 3
2023-08-22 14:55:45 PDT
It looks like the iOS media subsystem has gotten much more strict about extended MIME type validation. Specifically for `codecs=flac` they will only report support for the RFC4281 registered string 'fLaC'. However, WebKit has a case-insensitive cache of previous codec checks, so if anyone checks for 'flac' before checking for 'fLaC', those checks will always fail (and always succeed vice-versa if they were checked in a different order). So there's at least one intentional change and one underlying WebKit bug that is causing this behavior.
Jamie W
Comment 4
2023-08-22 15:24:57 PDT
As requested, I've prepared a minimal sample that reproduces the issue.
https://index.hm/dev/bug260491.html
https://index.hm/dev/bug260491.html?fLaC=1
That makes sense about the use of the ISO-BMFF codec strings. Indeed, using fLaC in the codecs string allows playback and is sufficient for us to support playback in the Safari 17 beta. Thank you for that :-) However, there is some discussion on an open issue in the W3C Media Source project that suggests the codecs should be treated as a MIME type from RFC7231, which defines the name tokens as being case insensitive. There doesn't yet seem to be consensus, however. Hopefully the maintainers of the specification can now clarify either way.
https://github.com/w3c/media-source/issues/188
I think it's also worth noting many samples on the internet that use FLAC inside ISO-BMFF (including this one in Google's Chrome repo) use the lower case string.
https://googlechrome.github.io/samples/media/flac-in-mp4-for-mse.html
Jer Noble
Comment 5
2023-08-22 17:20:06 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/16956
EWS
Comment 6
2023-08-24 15:15:20 PDT
Committed
267250@main
(73b6e9fe2ab4): <
https://commits.webkit.org/267250@main
> Reviewed commits have been landed. Closing PR #16956 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug