fluent-ffmpeg/node-fluent-ffmpeg

fmpeg.getAvailableFormats returns no records

wmodes opened this issue · 2 comments

Version information

  • fluent-ffmpeg version: 2.1.2
  • ffmpeg version: 7.0
  • OS: MacOs 13.6.5 (22G621)

Code to reproduce

// Utility function to fetch all ffmpeg data
async function fetchFfmpegDetails() {
    const getFormats = () => new Promise((resolve, reject) => {
        ffmpeg.getAvailableFormats((err, formats) => err ? reject(err) : resolve(formats));
    });
    const getCodecs = () => new Promise((resolve, reject) => {
        ffmpeg.getAvailableCodecs((err, codecs) => err ? reject(err) : resolve(codecs));
    });
    const getEncoders = () => new Promise((resolve, reject) => {
        ffmpeg.getAvailableEncoders((err, encoders) => err ? reject(err) : resolve(encoders));
    });
    const getFilters = () => new Promise((resolve, reject) => {
        ffmpeg.getAvailableFilters((err, filters) => err ? reject(err) : resolve(filters));
    });

    try {
        const [formats, codecs, encoders, filters] = await Promise.all([
            getFormats(), getCodecs(), getEncoders(), getFilters()
        ]);
        logger.debug(`Fetched ffmpeg details: ${Object.keys(formats).length} formats, ${Object.keys(codecs).length} codecs, ${Object.keys(encoders).length} encoders, ${Object.keys(filters).length} filters`);
        return { formats, codecs, encoders, filters };
    } catch (error) {
        throw error;
    }
}

Expected results

As with my successful queries with getAvailableCodecs, getAvailableEncoders, and getAvailableFilters(function, I expect getAvailableFormats to return records.

Observed results

No records are returned and no errors are thrown.

2024-04-20 21:02:10 debug: Fetched ffmpeg details: 0 formats, 598 codecs, 206 encoders, 447 filters

Note that ffmpeg -formats returns all the filters:

% ffmpeg -formats
ffmpeg version 7.0 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/7.0 --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-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --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-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
Formats:
 D.. = Demuxing supported
 .E. = Muxing supported
 ..d = Is a device
 ---
 D   3dostr          3DO STR
  E  3g2             3GP2 (3GPP2 file format)
  E  3gp             3GP (3GPP file format)
 D   4xm             4X Technologies
 . . .

i think it's the same issue as: #1266
alternatively, you can use ffmpeg 6 as a workaround:
brew install ffmpeg@6

Yes, you can directly install this package
#1266

node-fluent-ffmpeg-7 , and it will work out of the box. The issue is that ffmpeg changed its output patterns; we are trying to see if anybody here has permission to push a new version to the NPM package with the changes. In the meantime I made my changes available in the package fluent-ffmpeg-7 for anyone that needs it.