Opened 2 years ago
Closed 2 years ago
#9930 closed defect (fixed)
opus audio in caf container won't play on iOS
Reported by: | donald_i | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avformat |
Version: | git-master | Keywords: | opus ios caf |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
There appears to be a regression in ffmpeg 5 whereby opus audio, packaged as a caf (apple core audio), will not play in mobile safari. By contrast, the same input file, encoded with the same ffmpeg command line (but using the latest v4 build) will play.
(I am aware I lack the full knowledge to be sure this is an ffmpeg issue as opposed to something to do with the way Apple interpret the format. But I am moved to report it somewhere as I've spent a few days puzzling over why my audio wouldn't play and I'd like to spare others the same pain.)
I attach the full ffmpeg log for generating a working caf (using ffmpeg 4) and a non-working caf (using latest ffmpeg 5). I also attach the sample input MP3 file and the working and not-working caf files.
The ffmpeg command line is the same for both files, the only change is using ffmpeg v4 and ffmpeg v5.
ffmpeg -i 1.mp3 -y -map_metadata -1 -movflags +faststart -c:a libopus -b:a 24k -application voip 1.caf
The iOS syslog entries for the non-playing caf show these messages:
Sep 19 12:16:02 mediaserverd(MediaToolbox)[3913] <Notice>: <<<< FAQ >>>> subaq_buildCAAudioQueue: [0x13f831b20:0x13d644b60] Creating AudioQueue with format:'supo', framesPerPacket:962, sampleRate:48000 Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 1 ch, 48000 Hz, Float32 Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 1 ch, 24000 Hz, Float32 Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 1 ch, 16000 Hz, Float32 Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 1 ch, 12000 Hz, Float32 Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 2 ch, 48000 Hz, Float32, interleaved Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 1 ch, 8000 Hz, Float32 Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 2 ch, 24000 Hz, Float32, interleaved Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 2 ch, 16000 Hz, Float32, interleaved Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 2 ch, 12000 Hz, Float32, interleaved Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13707a640) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 962 frames/packet, 0 bytes/frame Sep 19 12:16:02 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13707a640) Output format: 2 ch, 8000 Hz, Float32, interleaved Sep 19 12:16:02 mediaserverd(AudioToolbox)[3913] <Error>: AudioQueueObject.cpp:401 AudioConverterNew from AudioQueueNew returned 1718449215
(The error code 1718449215 apparently indicates an unknown audio format.)
The working caf entry from the iOS syslog is much shorter:
Sep 19 12:21:52 mediaserverd(MediaToolbox)[3913] <Notice>: <<<< FAQ >>>> subaq_buildCAAudioQueue: [0x13d08fb50:0x141efb5e0] Creating AudioQueue with format:'supo', framesPerPacket:960, sampleRate:48000 Sep 19 12:21:52 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:120 (0x13708c040) Input format: 1 ch, 48000 Hz, opus (0x00000000) 0 bits/channel, 0 bytes/packet, 960 frames/packet, 0 bytes/frame Sep 19 12:21:52 mediaserverd(AudioCodecs)[3913] <Notice>: ACOpusDecoder.cpp:123 (0x13708c040) Output format: 1 ch, 48000 Hz, Float32 Sep 19 12:21:52 mediaserverd(AudioToolbox)[3913] <Notice>: AudioQueueObject.cpp:534 aq@0x13707e600: reporterID=0
Please note that both files play back fine with ffplay, and even work on Safari on macOS. It is necessary to open them in safari on an iOS device to see the behaviour reported. (My test was on an iPhone 7 running iOS 15.6.1) The easiest way to test the files is to run up a local webserver on a pc and then open them from the iOS device.
Attachments (5)
Change History (7)
by , 2 years ago
Attachment: | working_ffmpeg-20220920.log added |
---|
by , 2 years ago
Attachment: | not_working_ffmpeg-20220920-114709.log added |
---|
FFMPEG log for the not-working caf file, using FFMPEG v5
by , 2 years ago
Attachment: | doesntwork.caf added |
---|
The CAF file that will not play back on mobile safari.
comment:1 by , 2 years ago
Component: | undetermined → avformat |
---|---|
Priority: | normal → important |
Reproduced by developer: | set |
Status: | new → open |
Regression since ed240db9e3122d4dccbd1bee7d12cd50a0edc807
comment:2 by , 2 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Should be fixed in aa79d13f51aa820c7e5f07784a2512434e68bc46
FFMPEG log for the working CAF file (using FFMPEG v4)