0

Just trying to stdin and stdout a simple CAF to MP3 conversion. Output looks exactly the same except using stdin does not encode anything. Windows 10. I'm going bananas here. Please advise.

Using - (stdin)...

>type test.caf | ffmpeg -i - -f mp3 - > test.mp3
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, caf, from 'pipe:':
  Metadata:
    approximate duration in seconds: 3.1
    source bit depth: I16
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: adpcm_ima_qt (ima4 / 0x34616D69), 48000 Hz, stereo, s16p, 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (adpcm_ima_qt (native) -> mp3 (libmp3lame))
Output #0, mp3, to 'pipe:':
  Metadata:
    approximate duration in seconds: 3.1
    source bit depth: I16
    TSSE            : Lavf58.29.100
    Stream #0:0: Audio: mp3 (libmp3lame), 48000 Hz, stereo, s16p
    Metadata:
      encoder         : Lavc58.54.100 libmp3lame
size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Using -i...

>ffmpeg -i test.caf -f mp3 - > test.mp3
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, caf, from 'test.caf':
  Metadata:
    approximate duration in seconds: 3.1
    source bit depth: I16
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: adpcm_ima_qt (ima4 / 0x34616D69), 48000 Hz, stereo, s16p, 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (adpcm_ima_qt (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'pipe:':
  Metadata:
    approximate duration in seconds: 3.1
    source bit depth: I16
    TSSE            : Lavf58.29.100
    Stream #0:0: Audio: mp3 (libmp3lame), 48000 Hz, stereo, s16p
    Metadata:
      encoder         : Lavc58.54.100 libmp3lame
size=      49kB time=00:00:03.12 bitrate= 129.3kbits/s speed=34.4x
video:0kB audio:49kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.246501%

EDIT: Command syntax is ok. Works as expected with a WAV file. I upgraded FFmpeg now I get errors using stdin. So it is the file that is to blame. However, I do find it odd that using -i is fine, but stdin is not.

>ffmpeg -i - -f mp3 - > test.mp3 < test.caf
ffmpeg version 5.1.2-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.1.0 (Rev2, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
[caf @ 0000023dc65b1140] skipping CAF chunk: 00000000 ([0][0][0][0]), size 0
    Last message repeated 324 times
[caf @ 0000023dc65b1140] skipping CAF chunk: 00000000 ([0][0][0][0]), size 431131746560
[caf @ 0000023dc65b1140] skipping CAF chunk: 00000000 ([0][0][0][0]), size 173911953188585728
[caf @ 0000023dc65b1140] skipping CAF chunk: 00FFFF02 ([0][255][255][2]), size -7250317618881344622
pipe:: Invalid data found when processing input
brock
  • 439
  • 1
  • 5
  • 17
  • Why are you piping the output of `type test.caf` to `ffmpeg`? From the examples I've seen, like [this one](https://stackoverflow.com/a/45902691/6273251), they're piping the output of running `cat` on the file. As far as I can tell, the output of `type` does not contain the contents of the file, but just a string with some very general info. – Random Davis Feb 01 '23 at 22:44
  • @RandomDavis As stated, I'm on Windows. `cat` is a Linux console app. `type` is the Windows equivalent. Or an implied pipe using `<`, i.e. `ffmpeg -i - -f mp3 - > test.mp3 < test.caf`. Same result. No output. – brock Feb 01 '23 at 23:28

0 Answers0