diff --git a/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts b/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts index 65124d9fc8..c4e50497d7 100644 --- a/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts +++ b/types/fluent-ffmpeg/fluent-ffmpeg-tests.ts @@ -23,6 +23,25 @@ ffmpeg('/path/to/file.avi') .preset('divx') .size('640x480'); +// get arguments +ffmpeg('/path/to/file.avi') + + ._getArguments(); + +// ComplexFilter +ffmpeg('/path/to/file.avi') + + .output('outputfile.mp4') + .complexFilter([ + { inputs: '0:v', filter: 'scale', options: { w: 1920, h: 1080, interl: 1 }, outputs: [] }, + { inputs: '0:a', filter: 'amerge', options: { inputs: 2 }, outputs: 'am'}, + '[am]aresample=48000:async=1[are]', + { inputs: 'are', filter: 'channelsplit' , options: { channel_layout: 'stereo'}, outputs: [] } + ], []) + .audioCodec('libfaac') + .videoCodec('libx264') + .size('320x200'); + // Use the run() method to run commands with multiple outputs ffmpeg('/path/to/file.avi') .output('outputfile.mp4') diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index aa4c8cb02d..94debda123 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: KIM Jaesuck a.k.a. gim tcaesvk // DingWeizhe // Mounir Abid +// Doyoung Ha // Definitions: https://github.com/DefinitelyType/DefinitelyTyped /// @@ -31,8 +32,8 @@ declare namespace Ffmpeg { interface FilterSpecification { filter: string; - inputs: string | string[]; - outputs: string | string[]; + inputs?: string | string[]; + outputs?: string | string[]; options?: any | string | any[]; } @@ -271,8 +272,8 @@ declare namespace Ffmpeg { outputOption(...options: string[]): FfmpegCommand; outputOptions(options: string[]): FfmpegCommand; outputOptions(...options: string[]): FfmpegCommand; - filterGraph(spec: string | FilterSpecification[], map: string[]): FfmpegCommand; - complexFilter(spec: string | FilterSpecification[], map: string[]): FfmpegCommand; + filterGraph(spec: string | FilterSpecification | Array, map: string[]): FfmpegCommand; + complexFilter(spec: string | FilterSpecification | Array, map: string[]): FfmpegCommand; // options/misc usingPreset(proset: string | GetPreset): FfmpegCommand; @@ -281,6 +282,7 @@ declare namespace Ffmpeg { // processor renice(niceness: number): FfmpegCommand; kill(signal: string): FfmpegCommand; + _getArguments(): string[]; // capabilities setFfmpegPath(path: string): FfmpegCommand;