Page MenuHomePhabricator
Paste P6994

(An Untitled Masterwork)
ActivePublic

Authored by hashar on Apr 16 2018, 10:24 AM.
Tags
None
Referenced Files
F17006536:
Apr 16 2018, 10:24 AM
F17006535:
Apr 16 2018, 10:24 AM
Subscribers
None
// for https://gerrit.wikimedia.org/r/#/c/422933/
let ffmpeg;
const { spawn } = require( 'child_process' );
console.log('Spawning ffmpeg');
ffmpeg = spawn( 'ffmpeg', [
'-f', 'x11grab', // grab the X11 display
'-video_size', '1280x1024', // video size
'-i', process.env.DISPLAY, // input file url
'-loglevel', 'error', // log only errors
'-y', // overwrite output files without asking
'-pix_fmt', 'yuv420p', // QuickTime Player support, "Use -pix_fmt yuv420p for compatibility with outdated media players"
'-loglevel', 'info',
'-nostats',
'/tmp/foobar.mp4' // output file
] );
setTimeout(function () {
console.log('Timeout reached');
ffmpeg.kill('SIGKILL');
}, 3000);

Event Timeline

hashar updated the paste's language from autodetect to js.
hashar edited the content of this paste. (Show Details)