[FFmpeg-trac] #9930(undetermined:new): opus audio in caf container won't play on iOS
FFmpeg
trac at avcodec.org
Tue Sep 20 14:30:45 EEST 2022
#9930: opus audio in caf container won't play on iOS
-------------------------------------+-------------------------------------
Reporter: donald_i | Type: defect
Status: new | Priority: normal
Component: | Version: git-
undetermined | master
Keywords: opus ios | Blocked By:
caf |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
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 at 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.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9930>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list