browsertime
Version:
Get performance metrics from your web page using Browsertime.
30 lines (26 loc) • 555 B
JavaScript
import { execa } from 'execa';
import { getLogger } from '@sitespeed.io/log';
const log = getLogger('browsertime.video');
export async function convert(source, destination, crf, threads) {
const scriptArguments = [
'-nostdin',
'-i',
source,
'-c:v',
'libx264',
'-threads',
threads,
'-crf',
crf,
'-preset',
'fast',
'-vf',
'format=yuv420p',
destination
];
log.debug(
'Converting video to viewable format with args %j',
scriptArguments
);
return execa('ffmpeg', scriptArguments);
}