How to use the fluent-ffmpeg.getAvailableCodecs 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 pjobson / movie2ascii / movie2ascii.node.js View on Github external
ffmpeg.getAvailableCodecs((err, codecs) => {
			ffmpeg.getAvailableCodecs((err, codecs) => {
				console.log('Available read codecs:');
				for (const k in codecs) {
					if(codecs[k].canDecode) {
						console.log(`    - ${k}`);
					}
				}
				return deferred.resolve();
			});
		});
	}
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;
github littlstar / ls-psvr-encoder / encode.js View on Github external
const getCodecSupport = () => new Promise((resolve, reject) => {
  try {
    const useCodecs = { video: 'libx264' }
    ffmpeg.getAvailableCodecs((err, codecs) => {
      if (codecs['libfdk_aac']) {
        if (codecs['libfdk_aac'].canEncode === true) {
          useCodecs.audio = 'libfdk_aac'
          resolve(useCodecs)
        } else {
          useCodecs.audio = 'aac'
          resolve(useCodecs)
        }
      } else {
        useCodecs.audio = 'aac'
        resolve(useCodecs)
      }
    })
  } catch (err) { reject(err.stack || err) }
})