This class is responsible for creating the command from multiple fragments. These fragments can be passed to it's constructor, or to it's Compiler.compile method.
const input = new Input( 'movie.mkv' );
const filter = new Filter( input.select( 'v' ), 'scale', { width: 1080, height: 720 } );
const output = new Output( 'movie.mp4', [ '-map', filter, '-map', input.select( 'a' ) ] );
const compiler = new Compiler( output );
// Any aditional fragments can be passed on to the compile method
compiler.compile( output );
A compiler can be cloned at any time. This is useful when you want to create multiple, similar commands,
so you don't have to recompile every fragment, but can compile them first, and then clone the compiler as many times as necessary.
A command is composed of fragments: these can be an Input, an Output, a Filter, a Composite or a StreamRef.
This class is responsible for creating the command from multiple fragments. These fragments can be passed to it's constructor, or to it's
Compiler.compile
method.const input = new Input( 'movie.mkv' ); const filter = new Filter( input.select( 'v' ), 'scale', { width: 1080, height: 720 } ); const output = new Output( 'movie.mp4', [ '-map', filter, '-map', input.select( 'a' ) ] ); const compiler = new Compiler( output ); // Any aditional fragments can be passed on to the compile method compiler.compile( output );
Once all necessary fragments are compiled, you can obtain the CommandOptions as a string through
CommandOptions.toString
or an array of strings throughCommandOptions.toArray
A compiler can be cloned at any time. This is useful when you want to create multiple, similar commands, so you don't have to recompile every fragment, but can compile them first, and then clone the compiler as many times as necessary.