From 1c389ce93d7812925dba0a05d1981c05b3ce4f1d Mon Sep 17 00:00:00 2001 From: maxpaj Date: Wed, 30 Aug 2017 15:08:07 +0200 Subject: [PATCH 1/7] fluent-ffmpeg filter functions Added alternative parameter types for the filter functions. Resources: https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/search?utf8=%E2%9C%93&q=withAudioFilters&type= https://github.com/fluent-ffmpeg/node-fluent-ffmpeg/search?utf8=%E2%9C%93&q=withVideoFilters&type= --- types/fluent-ffmpeg/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index e1380dc78e..a27277e14a 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -144,10 +144,10 @@ declare namespace Ffmpeg { audioFrequency(freq: number): FfmpegCommand; withAudioQuality(quality: number): FfmpegCommand; audioQuality(quality: number): FfmpegCommand; - withAudioFilter(filters: { filter: string, options: any }): FfmpegCommand; - withAudioFilters(filters: { filter: string, options: any }): FfmpegCommand; - audioFilter(filters: { filter: string, options: any }): FfmpegCommand; - audioFilters(filters: { filter: string, options: any }): FfmpegCommand; + withAudioFilter(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; + withAudioFilters(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; + audioFilter(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; + audioFilters(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; // options/video; withNoVideo(): FfmpegCommand; @@ -156,10 +156,10 @@ declare namespace Ffmpeg { videoCodec(codec: string): FfmpegCommand; withVideoBitrate(bitrate: string | number): FfmpegCommand; videoBitrate(bitrate: string | number): FfmpegCommand; - withVideoFilter(filters: { filter: string, options: any }): FfmpegCommand; - withVideoFilters(filters: { filter: string, options: any }): FfmpegCommand; - videoFilter(filters: { filter: string, options: any }): FfmpegCommand; - videoFilters(filters: { filter: string, options: any }): FfmpegCommand; + withVideoFilter(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; + withVideoFilters(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; + videoFilter(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; + videoFilters(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; withOutputFps(fps: number): FfmpegCommand; withOutputFPS(fps: number): FfmpegCommand; withFpsOutput(fps: number): FfmpegCommand; From e31c1ee9197a888eb58d1265a60adb5f4afae029 Mon Sep 17 00:00:00 2001 From: maxpaj Date: Wed, 30 Aug 2017 15:12:14 +0200 Subject: [PATCH 2/7] Change signature type from Object to Object[] --- types/fluent-ffmpeg/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index a27277e14a..5d45a3d465 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -144,10 +144,10 @@ declare namespace Ffmpeg { audioFrequency(freq: number): FfmpegCommand; withAudioQuality(quality: number): FfmpegCommand; audioQuality(quality: number): FfmpegCommand; - withAudioFilter(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; - withAudioFilters(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; - audioFilter(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; - audioFilters(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; + withAudioFilter(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; + withAudioFilters(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; + audioFilter(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; + audioFilters(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; // options/video; withNoVideo(): FfmpegCommand; @@ -156,10 +156,10 @@ declare namespace Ffmpeg { videoCodec(codec: string): FfmpegCommand; withVideoBitrate(bitrate: string | number): FfmpegCommand; videoBitrate(bitrate: string | number): FfmpegCommand; - withVideoFilter(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; - withVideoFilters(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; - videoFilter(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; - videoFilters(filters: { filter: string, options: any } | String | String[]): FfmpegCommand; + withVideoFilter(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; + withVideoFilters(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; + videoFilter(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; + videoFilters(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; withOutputFps(fps: number): FfmpegCommand; withOutputFPS(fps: number): FfmpegCommand; withFpsOutput(fps: number): FfmpegCommand; From 9bf1a6a4d656eaf17f64f53ae62aaf91a912ee43 Mon Sep 17 00:00:00 2001 From: maxpaj Date: Thu, 31 Aug 2017 09:03:48 +0200 Subject: [PATCH 3/7] Replaced `String` type with `string` --- types/fluent-ffmpeg/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index 5d45a3d465..1b86816787 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -144,10 +144,10 @@ declare namespace Ffmpeg { audioFrequency(freq: number): FfmpegCommand; withAudioQuality(quality: number): FfmpegCommand; audioQuality(quality: number): FfmpegCommand; - withAudioFilter(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; - withAudioFilters(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; - audioFilter(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; - audioFilters(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; + withAudioFilter(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; + withAudioFilters(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; + audioFilter(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; + audioFilters(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; // options/video; withNoVideo(): FfmpegCommand; @@ -156,10 +156,10 @@ declare namespace Ffmpeg { videoCodec(codec: string): FfmpegCommand; withVideoBitrate(bitrate: string | number): FfmpegCommand; videoBitrate(bitrate: string | number): FfmpegCommand; - withVideoFilter(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; - withVideoFilters(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; - videoFilter(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; - videoFilters(filters: { filter: string, options: any }[] | String | String[]): FfmpegCommand; + withVideoFilter(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; + withVideoFilters(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; + videoFilter(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; + videoFilters(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; withOutputFps(fps: number): FfmpegCommand; withOutputFPS(fps: number): FfmpegCommand; withFpsOutput(fps: number): FfmpegCommand; From 27baba70b1aa52050b14fa40fa093928e972523a Mon Sep 17 00:00:00 2001 From: maxpaj Date: Thu, 31 Aug 2017 09:23:24 +0200 Subject: [PATCH 4/7] Corrected parameters and extracted AudoVideoFilter interface --- types/fluent-ffmpeg/index.d.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index 1b86816787..2ecd56f1a5 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -104,6 +104,11 @@ declare namespace Ffmpeg { fastSeek?: boolean; size?: string; } + + interface AudioVideoFilter { + filter: string; + options: string | string[] | Object; + } class FfmpegCommand extends events.EventEmitter { constructor(options?: FfmpegCommandOptions); @@ -144,10 +149,10 @@ declare namespace Ffmpeg { audioFrequency(freq: number): FfmpegCommand; withAudioQuality(quality: number): FfmpegCommand; audioQuality(quality: number): FfmpegCommand; - withAudioFilter(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; - withAudioFilters(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; - audioFilter(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; - audioFilters(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; + withAudioFilter(filters: string | string[] | Array): FfmpegCommand; + withAudioFilters(filters: string | string[] | Array): FfmpegCommand; + audioFilter(filters: string | string[] | Array): FfmpegCommand; + audioFilters(filters: string | string[] | Array): FfmpegCommand; // options/video; withNoVideo(): FfmpegCommand; @@ -156,10 +161,10 @@ declare namespace Ffmpeg { videoCodec(codec: string): FfmpegCommand; withVideoBitrate(bitrate: string | number): FfmpegCommand; videoBitrate(bitrate: string | number): FfmpegCommand; - withVideoFilter(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; - withVideoFilters(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; - videoFilter(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; - videoFilters(filters: { filter: string, options: any }[] | string | Array): FfmpegCommand; + withVideoFilter(filters: string | string[] | Array): FfmpegCommand; + withVideoFilters(filters: string | string[] | Array): FfmpegCommand; + videoFilter(filters: string | string[] | Array): FfmpegCommand; + videoFilters(filters: string | string[] | Array): FfmpegCommand; withOutputFps(fps: number): FfmpegCommand; withOutputFPS(fps: number): FfmpegCommand; withFpsOutput(fps: number): FfmpegCommand; From 79e7c252f342624e5cca70cebe1db8fbdb467fdc Mon Sep 17 00:00:00 2001 From: maxpaj Date: Thu, 31 Aug 2017 09:34:11 +0200 Subject: [PATCH 5/7] Fix Travis errors --- types/fluent-ffmpeg/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index 2ecd56f1a5..2f57bb8347 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -104,10 +104,10 @@ declare namespace Ffmpeg { fastSeek?: boolean; size?: string; } - + interface AudioVideoFilter { filter: string; - options: string | string[] | Object; + options: string | string[] | object; } class FfmpegCommand extends events.EventEmitter { @@ -149,10 +149,10 @@ declare namespace Ffmpeg { audioFrequency(freq: number): FfmpegCommand; withAudioQuality(quality: number): FfmpegCommand; audioQuality(quality: number): FfmpegCommand; - withAudioFilter(filters: string | string[] | Array): FfmpegCommand; - withAudioFilters(filters: string | string[] | Array): FfmpegCommand; - audioFilter(filters: string | string[] | Array): FfmpegCommand; - audioFilters(filters: string | string[] | Array): FfmpegCommand; + withAudioFilter(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand; + withAudioFilters(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand; + audioFilter(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand; + audioFilters(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand; // options/video; withNoVideo(): FfmpegCommand; From 7644721413e0d93332f6794454889c86eb92784a Mon Sep 17 00:00:00 2001 From: maxpaj Date: Thu, 31 Aug 2017 09:34:53 +0200 Subject: [PATCH 6/7] Some more fix... --- types/fluent-ffmpeg/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index 2f57bb8347..97b07c8bd6 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -161,10 +161,10 @@ declare namespace Ffmpeg { videoCodec(codec: string): FfmpegCommand; withVideoBitrate(bitrate: string | number): FfmpegCommand; videoBitrate(bitrate: string | number): FfmpegCommand; - withVideoFilter(filters: string | string[] | Array): FfmpegCommand; - withVideoFilters(filters: string | string[] | Array): FfmpegCommand; - videoFilter(filters: string | string[] | Array): FfmpegCommand; - videoFilters(filters: string | string[] | Array): FfmpegCommand; + withVideoFilter(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand; + withVideoFilters(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand; + videoFilter(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand; + videoFilters(filters: string | string[] | AudioVideoFilter[]): FfmpegCommand; withOutputFps(fps: number): FfmpegCommand; withOutputFPS(fps: number): FfmpegCommand; withFpsOutput(fps: number): FfmpegCommand; From fe214f98c28b65e99038b59d259b7a73f9340126 Mon Sep 17 00:00:00 2001 From: maxpaj Date: Thu, 31 Aug 2017 09:41:49 +0200 Subject: [PATCH 7/7] Use `{}` instead of `object`. --- types/fluent-ffmpeg/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/fluent-ffmpeg/index.d.ts b/types/fluent-ffmpeg/index.d.ts index 97b07c8bd6..87bdbfe15c 100644 --- a/types/fluent-ffmpeg/index.d.ts +++ b/types/fluent-ffmpeg/index.d.ts @@ -107,7 +107,7 @@ declare namespace Ffmpeg { interface AudioVideoFilter { filter: string; - options: string | string[] | object; + options: string | string[] | {}; } class FfmpegCommand extends events.EventEmitter {