How to use the fluent-ffmpeg.getAvailableFormats 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
if (idx%6 === 0) {
					fout.push([]);
				}
				fout[fout.length-1].push(font);
			});

			console.log(columnify(fout, {
				showHeaders: false
			}));

			return deferred.resolve();
		});
	}
	// List of FFMPEG Decodable Formats
	if (global.info.formats) {
		ffmpeg.getAvailableFormats((err, formats) => {
			console.log('Available read formats:');
			for (const k in formats) {
				if(formats[k].canDemux) {
					console.log(`    - ${k}`);
				}
			}
			return deferred.resolve();
		});
	}
	// List of FFMPEG Decodable Codecs
	if (global.info.codecs) {
		ffmpeg.getAvailableCodecs((err, codecs) => {
			ffmpeg.getAvailableCodecs((err, codecs) => {
				console.log('Available read codecs:');
				for (const k in codecs) {
					if(codecs[k].canDecode) {
github gre / diaporama-recorder / server / Video.js View on Github external
var ffmpeg = require("fluent-ffmpeg");
var Q = require("q");
var common = require("../src/common");

var formatsD = Q.defer();

var InterestingFormats = "m4v matroska webm avi 3gp flv mov mp4".split(" ");

ffmpeg.getAvailableFormats(function(err, all) {
  if (err) return formatsD.reject(err);
  var formats = {};
  for (var i = 0; i < InterestingFormats.length; ++i) {
    var k = InterestingFormats[i];
    if (k in all) {
      formats[k] = all[k];
    }
  }
  formatsD.resolve(formats);
});

var notIdentityExtension = {
  matroska: "mkv"
};
function formatToExtension (format) {
  if (format in notIdentityExtension) return notIdentityExtension[format];
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);
            });
          }),
        ]);
github galtproject / geesome-node / components / drivers / preview / video-thumbnail.ts View on Github external
return (new Promise((resolve, reject) => {
      ffmpeg.getAvailableFormats(function(err, formats) {
        if(err) {
          reject(err);
        }
        resolve(!!formats[extension]);
      });
    })) as any;
  }