Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'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',
'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',
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, '/')
}
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
'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 = [
'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 = [
'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];
}
'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 = {
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);
}
}
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,