Post

Replies

Boosts

Views

Activity

Reply to WebM audio playback
AVPlayer does not support WebM. However, WebKit has implemented its own demuxer for WebM playback and also supports a private entitlement for VP9 decoding. To play WebM files in a native iOS app, you have a few options: 1. Remux the WebM container to MP4. If you’re using the Opus codec, AVPlayer can handle it in an MP4 container. However, I’m not sure exactly which iOS version introduced support. For example, it doesn’t work on iOS 15, but it does on iOS 17. On older iOS versions, AVPlayer is unable to construct the Opus codec info from the container, even though decoding itself is supported. 2. Write a WebM demuxer (or use FFmpeg), extract the samples, decode them, and play them back using AVAudioEngine or AudioQueue. For decoding, you can use FFmpeg, AVAudioConverter, or AudioConverter.
Topic: Media Technologies SubTopic: Audio Tags:
Apr ’25
Reply to VideoToolbox AV1 decoding on Apple platforms
AV1 not only supported on iPhone 15 Pro, but it is available without special entitlement. Used this code to check func listVideoDecoders() { let codecTypes: [CMVideoCodecType: String] = [ kCMVideoCodecType_H264: "H.264", kCMVideoCodecType_HEVC: "H.265", kCMVideoCodecType_HEVCWithAlpha: "H.265 alpha", kCMVideoCodecType_DolbyVisionHEVC: "H.265 dolby vision", kCMVideoCodecType_AV1: "AV1", kCMVideoCodecType_VP9: "VP9", ] for (codecType, codecName) in codecTypes { let isSupported = VTIsHardwareDecodeSupported(codecType) if isSupported { print("Hardware decoder available for codec: \(codecName)") } else { print("Hardware decoder not available for codec: \(codecName)") } } } Result: Hardware decoder available for codec: H.265 alpha Hardware decoder available for codec: H.265 dolby vision Hardware decoder available for codec: AV1 Hardware decoder available for codec: H.265 Hardware decoder available for codec: H.264 Hardware decoder not available for codec: VP9 But it's a bummer that you still need a special entitlement to use VP9
Topic: Media Technologies SubTopic: Video Tags:
Oct ’23