This works:
ffmpeg -i test.caf recoded.opus
ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
built with Apple clang version 15.0.0 (clang-1500.0.40.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/6.0_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
Input #0, caf, from 'test.caf':
Duration: 00:00:05.34, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: opus (opus / 0x7375706F), 48000 Hz, stereo, fltp
Stream mapping:
Stream #0:0 -> #0:0 (opus (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libopus @ 0x7fa8a0708580] No bit rate set. Defaulting to 96000 bps.
Output #0, opus, to 'recoded.opus':
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Audio: opus, 48000 Hz, stereo, flt, 96 kb/s
Metadata:
encoder : Lavc60.3.100 libopus
size= 69kB time=00:00:05.33 bitrate= 106.2kbits/s speed= 112x
video:0kB audio:68kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.118284%
This does not work
ffmpeg -i test.caf -acodec copy recoded.opus
ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
built with Apple clang version 15.0.0 (clang-1500.0.40.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/6.0_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
Input #0, caf, from 'test.caf':
Duration: 00:00:05.34, start: 0.000000, bitrate: 32 kb/s
Stream #0:0: Audio: opus (opus / 0x7375706F), 48000 Hz, stereo, fltp
[opus @ 0x7f875cf076c0] No extradata present
[out#0/opus @ 0x7f875cf07600] Could not write header (incorrect codec parameters ?): Invalid data found when processing input
[aost#0:0/copy @ 0x7f875cf08240] Error initializing output stream:
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Last message repeated 1 times
Clearly ffmpeg is able to read and decode the frames from the .caf container correctly, because it has no issues re-encoding them to .ogg container. But direct frame copy fails?