Skip to content

Instantly share code, notes, and snippets.

@JosePedroDias
Created May 9, 2014 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JosePedroDias/10a1af2f3b58fafd4870 to your computer and use it in GitHub Desktop.
Save JosePedroDias/10a1af2f3b58fafd4870 to your computer and use it in GitHub Desktop.
outputs avconv configuration
// argument input_file
// process inFile and outFile
var inFile = process.argv.pop();
var cutAt = inFile.lastIndexOf('.');
var inExt = inFile.substr(cutAt + 1);
var inName = inFile.substr(0, cutAt);
var outFile = [inName, 'mp4'].join('.');
var cmd = [
'avconv',
'-i', inFile,
'-f', 'mp4',
'-c:v', 'libx264',
// '-c:v', 'mpeg4',
'-preset', 'ultrafast',
'-b:v 2M -maxrate 1M -minrate 1M -bufsize 1M',
'-r', 25,
'-s', '480x270',
// '-c:a', 'aac',
'-c:a', 'libvo_aacenc',
// '-c:a', 'libmp3lame',
//'-c:a', 'copy',
'-b:a', '96k',
//'-ss', '00:00:00', // start at hh:mm:ss[.xxx]
//'-t', 60, // trim duration, in seconds or hh:mm:ss[.xxx]
outFile
].join(' ');
console.log(cmd);
/*
list formats:
avconv -formats
list encoder codecs:
avconv -codecs|grep "^..EV"|less
avconv -codecs|grep "^..EA"|less
http://libav.org/avconv.html
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment