Support for webm playback and processing

Hi, Safari supports playing back webm files (such as those recorded by Chrome/Firefox browsers with the MediaRecorder API), but our native app is unable to play these back with AVPlayer. Is there a supported way to do this? Right now we have to use a WebView for this!

Would also love to ExtAudioFileURLOpen or process these files with AVAudioEngine.

Have I missed something obvious here?

Answered by Media Engineer in 891998022

Hi, if your native app cannot play a webm file while Safari can, that could be because of unsupported audio format in the webm file. webm file format may contain Opus or Vorbis audio track. Opus codec is available for developers on all Apple platforms, but unfortunately, Vorbis codec is not. Vorbis decoder is pretty old audio codec, and ported to only a few Apple services, e.g. Safari.

So, there is no supported way for you to make it work with the APIs currently available. If you'd like us to consider adding the audio codec functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here. If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

Hi, if your native app cannot play a webm file while Safari can, that could be because of unsupported audio format in the webm file. webm file format may contain Opus or Vorbis audio track. Opus codec is available for developers on all Apple platforms, but unfortunately, Vorbis codec is not. Vorbis decoder is pretty old audio codec, and ported to only a few Apple services, e.g. Safari.

So, there is no supported way for you to make it work with the APIs currently available. If you'd like us to consider adding the audio codec functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here. If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?

OK that's very interesting because it's a .webm file with an Opus track. @Media Engineer it sounds like from your POV this should just work the way other audio files do?

This has given me enough info to enhance my existing feedback (honestly wasn't sure if this was a bug in my code or lack of support in the OS) - take a look at FB15639450.

I tried the webm file attached to the FB. It might not be a codec format issue, but more like a container file format one. WebKit in Safari could open and parse webm container format, but maybe CoreAudio not. My team is not familiar with container file formats. I'll send this to a team who is in charge of the file format. You could keep tracking this through the FB.

AVFoundation/QuickTime Player have artificial restrictions on what it can read.

Safari brings its own webm demuxer, and the VP9 decoder is not enabled by default, so to playback it in your on app (at least from a .mp4 file), you need to call VTRegisterSupplementalVideoDecoderIfAvailable(kCMVideoCodecType_VP9)

I think at the moment the only way to read a WebM file in AVFoundation is stored write your own demuxer using the MediaExtension framework ( https://developer.apple.com/documentation/mediaextension )

Support for webm playback and processing
 
 
Q