DuFFMpeg(optionsopt)

A class used to easily encode medias with ffmpeg

new DuFFMpeg(optionsopt)

Constructs a new FFMpeg encoder. The constructor will try to find the ffmpeg binary in the same folder as DuFFMpeg, or an (ffmpeg) subfolder, or in the scripts folder of After Effects. If ffmpeg is not in one of those, the property ffmpegPath will be an empty string, and it has to be set by the user.
Parameters:
Name Type Attributes Default Description
options string <optional>
-stats The options of the encoder.
Properties:
Name Type Description
ffmpegPath string The path to the FFMpeg binary.
options string The options of the encoder.
queue Array.<FFMpegQueueItem> The render queue
Examples
//Very simple transcoding
//create a new FFMpeg instance
var ffmpeg = new DuFFMpeg();
//input file. Note that you can use any path format you want, URI, fsName, or path, using either / or \
var input = new DuFFMpegInputModule('C:/RAINBOX/Test video 1.mp4');
//output to an audio wav file using PCM 32 bit float little-endian codec
var output = new DuFFMpegOutputModule('pcm_f32le','C:/RAINBOX/Test audio 1.wav');
//create the render queue item
var item = new DuFFMpegQueueItem(input,[output]);
//add the item to the render queue
ffmpeg.queue.push(item);

ffmpeg.launch(); //and launch the process!
//Transcoding two different files, and a few more options
//new FFMpeg instance, encoding will overwrite files, and statistics will be shown
var ffmpeg = new DuFFMpeg('-y -stats');
//input file
var input = new DuFFMpegInputModule('C:/RAINBOX/Test video 1.mp4');
//output to an audio wav file using PCM 32 bit float little-endian codec, forcing 48000Hz sampling and disabling video
var output = new DuFFMpegOutputModule('pcm_f32le','C:/RAINBOX/Test audio 1.wav','-ar 48000 -vn');
//create the render queue item
var item = new DuFFMpegQueueItem(input,[output]);
//add the item to the render queue
ffmpeg.queue.push(item);

//another render queue item
var input = new DuFFMpegInputModule('C:/RAINBOX/Test video 2.mp4');
var output = new DuFFMpegOutputModule('pcm_f32le','C:/RAINBOX/Test audio 2.wav','-ar 48000 -vn');
var item = new DuFFMpegQueueItem(input,[output]);
ffmpeg.queue.push(item);

//and launch the process! Both items will be transcoded.
ffmpeg.launch();

Methods

launch()

Launches encoding