Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Compiler

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 through CommandOptions.toArray

compiler.command.toString();
compiler.command.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.

Hierarchy

  • Compiler

Implements

Index

Constructors

constructor

Properties

Protected compiledFragments

compiledFragments: Set<IFragment> = new Set()

filterGraph

filterGraph: FiltergraphCommandOptions = new FiltergraphCommandOptions()

inputs

inputs: CommandOptions = new CommandOptions()

options

options: CommandOptions = new CommandOptions()

outputs

outputs: CommandOptions = new CommandOptions()

Protected sources

sources: IndexableIdentifierGenerator<Stream> = new IndexableIdentifierGenerator( 0 )

Protected streamRefs

streamRefs: Map<string, StreamRef> = new Map()

Protected streams

streams: PrefixableIdentifierGenerator<Stream> = new PrefixableIdentifierGenerator<Stream>( 'stream' )

Accessors

command

Methods

clone

compile

getInputStreamName

  • getInputStreamName(stream: Stream): number

getStreamName

  • getStreamName(stream: Stream): string

getStreamRef

hasStreamName

  • hasStreamName(stream: Stream): boolean

setStreamName

  • setStreamName(stream: Stream, name: string): this

Generated using TypeDoc