How to use the @ffmpeg-installer/ffmpeg.path function in @ffmpeg-installer/ffmpeg

To help you get started, we’ve selected a few @ffmpeg-installer/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 kevinGodell / mp4frag / tests / test10.js View on Github external
'use strict';

console.time('=====> test10.js');

const { Writable } = require('stream');

const assert = require('assert');

const Mp4Frag = require('../index');

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;

const { spawn } = require('child_process');

const count = 1; //expected count of segments

const frames = 1;

const fps = 24; //number of frames per second(same as input video) might not be necessary

const scale = 640; //used as width of video, height will automatically scale

let counter = 0;

const params = [
  /* log info to console */
  '-loglevel',
github kevinGodell / mp4frag / tests / test6.js View on Github external
'use strict';

console.time('=====> test6.js');

const assert = require('assert');

const Mp4Frag = require('../index');

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;

const { spawn } = require('child_process');

const frameLimit = 2001;

const scale = 320;

const fps = 200;

const count = Math.ceil(frameLimit / fps);

let counter = 0;

const params = [
  /* log info to console */
  '-loglevel',
github wonderunit / storyboarder / src / js / exporters / ffmpeg.js View on Github external
const electronUtil = require('electron-util')
const execa = require('execa')
const ffmpeg = require('@ffmpeg-installer/ffmpeg')
const fs = require('fs-extra')
const path = require('path')
const moment = require('moment')
const tmp = require('tmp')

const boardModel = require('../models/board')
const exporterCommon = require('../exporters/common')

const ffmpegPath = electronUtil.fixPathForAsarUnpack(ffmpeg.path)

// const durationRegex = /Duration: (\d\d:\d\d:\d\d.\d\d)/gm
// const frameRegex = /frame=\s+(\d+)/gm

// via https://github.com/sindresorhus/slash/blob/master/index.js
const slash = input => {
	const isExtendedLengthPath = /^\\\\\?\\/.test(input)
	const hasNonAscii = /[^\u0000-\u0080]+/.test(input)

	if (isExtendedLengthPath || hasNonAscii) {
		return input
	}

	return input.replace(/\\/g, '/')
}
github cypress-io / cypress / packages / server / lib / video_capture.js View on Github external
const _ = require('lodash')
const utils = require('fluent-ffmpeg/lib/utils')
const debug = require('debug')('cypress:server:video')
const ffmpeg = require('fluent-ffmpeg')
const stream = require('stream')
const Promise = require('bluebird')
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path
const BlackHoleStream = require('black-hole-stream')
const fs = require('./util/fs')

// extra verbose logs for logging individual frames
const debugFrames = require('debug')('cypress-verbose:server:video:frames')

debug('using ffmpeg from %s', ffmpegPath)

ffmpeg.setFfmpegPath(ffmpegPath)

const deferredPromise = function () {
  let reject
  let resolve = (reject = null)
  const promise = new Promise((_resolve, _reject) => {
    resolve = _resolve
    reject = _reject
github kevinGodell / mp4frag / tests / test4.js View on Github external
'use strict';

console.time('=====> test4.js');

const assert = require('assert');

const Mp4Frag = require('../index');

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;

const { spawn } = require('child_process');

const frameLimit = 200;

const gop = 10;

const count = Math.ceil(frameLimit / gop); //expected number of segments to be cut from ffmpeg

const scale = 320;

const fps = 10;

let counter = 0;

const params = [
github kevinGodell / mp4frag / tests / test2.js View on Github external
'use strict';

console.time('=====> test2.js');

const assert = require('assert');

const Mp4Frag = require('../index');

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;

const { spawn } = require('child_process');

const frameLimit = 200;

const gop = 5;

const count = Math.ceil(frameLimit / gop); //expected number of segments to be cut from ffmpeg

const scale = 640;

const fps = 10;

let counter = 0;

const params = [
github woodsyang / rockplayer / src / main / VideoServer.js View on Github external
'use strict';
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffprobePath = require('@ffprobe-installer/ffprobe').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);
ffmpeg.setFfprobePath(ffprobePath);
const http = require('http');

function getParam(url, key) {
    var param = new Object();
    var item = new Array();
    var urlList = url.split("?");
    var req;
    if (urlList.length == 1) {
        req = urlList[0];
    } else {
        req = urlList[1];
    }
github woodsyang / rockplayer / src / main / ffmpeg-helper.js View on Github external
'use strict';
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffprobePath = require('@ffprobe-installer/ffprobe').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);
ffmpeg.setFfprobePath(ffprobePath);

var videoSupport = function (videoPath) {
    let p = new Promise(function (resolve, reject) {
        let command = ffmpeg()
            .input(videoPath)
            .ffprobe(function (err, data) {
                if (err) {
                    reject(err);
                    return;
                }
                var streams = data.streams;
                var checkResult = {
github presidenten / wdio-video-reporter / dist / wdio-video-reporter.js View on Github external
try {
        browser.saveScreenshot(filePath);
        helpers.debugLog('- Screenshot!!\n');
      } catch (e) {
        fs.writeFile(filePath, notAvailableImage, 'base64');
        helpers.debugLog('- Screenshot not available...\n');
      }

      const videoPath = path.resolve(config.outputDir, this.testname + '.mp4');
      this.videos.push(videoPath);

      if (config.usingAllure) {
        allureReporter.addAttachment('Execution video', videoPath, 'video/mp4');
      }

      const command = `"${ffmpeg.path}" -y -r 10 -i "${this.recordingPath}/%04d.png" -vcodec libx264` +
        ` -crf 32 -pix_fmt yuv420p -vf "scale=1200:trunc(ow/a/2)*2","setpts=${config.videoSlowdownMultiplier}.0*PTS"` +
        ` "${path.resolve(config.outputDir, this.testname)}.mp4"`;

      helpers.debugLog(`ffmpeg command: ${command}\n`);

      this.ffmpegCommands.push(command);
    }
  }
github wulkano / kap / main / export-list.js View on Github external
const ffmpeg = require('@ffmpeg-installer/ffmpeg');
const util = require('electron-util');
const execa = require('execa');
const makeDir = require('make-dir');
const moment = require('moment');

const settings = require('./common/settings');
const {track} = require('./common/analytics');
const {openPrefsWindow} = require('./preferences');
const {getExportsWindow, openExportsWindow} = require('./exports');
const {openEditorWindow} = require('./editor');
const {toggleExportMenuItem} = require('./menus');
const Export = require('./export');
const {ensureDockIsShowingSync} = require('./utils/dock');

const ffmpegPath = util.fixPathForAsarUnpack(ffmpeg.path);
let lastSavedDirectory;

const filterMap = new Map([
  ['mp4', [{name: 'Movies', extensions: ['mp4']}]],
  ['webm', [{name: 'Movies', extensions: ['webm']}]],
  ['gif', [{name: 'Images', extensions: ['gif']}]],
  ['apng', [{name: 'Images', extensions: ['apng']}]]
]);

const getPreview = async inputPath => {
  const previewPath = tmp.tmpNameSync({postfix: '.jpg'});
  await execa(ffmpegPath, [
    '-ss', 0,
    '-i', inputPath,
    '-t', 1,
    '-vframes', 1,

@ffmpeg-installer/ffmpeg

Platform independent binary installer of FFmpeg for node projects

LGPL-2.1
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis