How to use the fluent-ffmpeg.getAvailableEncoders function in fluent-ffmpeg

To help you get started, we’ve selected a few fluent-ffmpeg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zhen-ke / ffmpegGUI / src / utils / core.js View on Github external
(err, stdoutRing) => {
          if (err) {
            reject(err);
          }
          let stdout = stdoutRing.get();
          let lines = [
            ...new Set(
              stdout
                .replace("Hardware acceleration methods:", "")
                .replace(/\n/g, " ")
                .trim()
                .split(" ")
            )
          ];
          ffmpeg.getAvailableEncoders((err, encoders) => {
            if (err) {
              reject(err);
            }
            let reslut = lines.reduce((total, it) => {
              return total.concat(
                Object.keys(encoders).filter(encodersName =>
                  encodersName.includes(it)
                )
              );
            }, []);
            resolve(reslut);
          });
        }
      );
github WagonOfDoubt / kotoba.js / app / src / routes / manage / index.js View on Github external
async (req, res, next) => {
    try {
      const promisify = (fn) =>
        new Promise((resolve, reject) =>
          fn((err, data) => err ? reject(err) : resolve(data)));

      const [
        formats, codecs, encoders, filters, postcount, boardcount, spaceused
        ] = await Promise.all([
          promisify(ffmpeg.getAvailableFormats),
          promisify(ffmpeg.getAvailableCodecs),
          promisify(ffmpeg.getAvailableEncoders),
          promisify(ffmpeg.getAvailableFilters),
          Post.estimatedDocumentCount(),
          Board.estimatedDocumentCount(),
          new Promise((resolve, reject) => {
            du(config.html_path, (err, size) => {
              if (err) {
                reject(err);
                return;
              }
              resolve(size);
            });
          }),
        ]);

      const ffmpegPath = process.env.FFMPEG_PATH;
      const ffprobePath = process.env.FFPROBE_PATH;