-
Notifications
You must be signed in to change notification settings - Fork 4
/
encoding_output_parameters.ts
148 lines (119 loc) · 3.44 KB
/
encoding_output_parameters.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import {
FFmpegBaseOptions,
FFmpegBaseParameters,
} from "./encoding_base_parameters.ts";
export interface FFmpegOutputOptions extends FFmpegBaseOptions {
audioBitrate?: number | string;
audioQuality?: number;
frames?: number;
height?: number | string;
loop?: number | string;
maxVideoBitrate?: number | string;
minVideoBitrate?: number | string;
override?: boolean;
// rotate?: number;
videoBitrate?: number | string;
videoBufSize?: number | string;
width?: number | string;
}
/** output parameters */
export abstract class AbstractFFmpegOutputParameters
extends FFmpegBaseParameters<FFmpegOutputOptions>
implements FFmpegOutputOptions {
protected constructor(options: FFmpegOutputOptions = {}) {
super(options);
}
get override(): boolean | undefined {
return this.opts.override;
}
set override(enable: boolean | undefined) {
this.opts.override = enable;
}
get audioBitrate(): number | string | undefined {
return this.opts.audioBitrate;
}
set audioBitrate(audioBitrate: number | string | undefined) {
this.opts.audioBitrate = audioBitrate;
}
get videoBitrate(): number | string | undefined {
return this.opts.videoBitrate;
}
set videoBitrate(videoBitrate: number | string | undefined) {
this.opts.videoBitrate = videoBitrate;
}
get minVideoBitrate(): number | string | undefined {
return this.opts.minVideoBitrate;
}
set minVideoBitrate(bitrate: number | string | undefined) {
this.opts.minVideoBitrate = bitrate;
}
get maxVideoBitrate(): number | string | undefined {
return this.opts.maxVideoBitrate;
}
set maxVideoBitrate(bitrate: number | string | undefined) {
this.opts.maxVideoBitrate = bitrate;
}
get videoBufSize(): number | string | undefined {
return this.opts.videoBufSize;
}
set videoBufSize(size: number | string | undefined) {
this.opts.videoBufSize = size;
}
get width(): number | string | undefined {
return this.opts.width;
}
set width(width: number | string | undefined) {
this.opts.width = width;
}
get height(): number | string | undefined {
return this.opts.height;
}
set height(height: number | string | undefined) {
this.opts.height = height;
}
get frames(): number | undefined {
return this.opts.frames;
}
set frames(frames: number | undefined) {
this.opts.frames = frames;
}
get audioQuality(): number | undefined {
return this.opts.audioQuality;
}
set audioQuality(audioQuality: number | undefined) {
this.opts.audioQuality = audioQuality;
}
get loop(): number | string | undefined {
return this.opts.loop;
}
set loop(loop: number | string | undefined) {
this.opts.loop = loop;
}
// get rotate(): number | undefined {
// return this.opts.rotate;
// }
//
// set rotate(deg: number | undefined) {
// this.opts.rotate = deg;
// }
}
export class FFmpegOutputParameters extends AbstractFFmpegOutputParameters {
get options(): FFmpegOutputOptions {
return this.opts;
}
set options(options: FFmpegOutputOptions) {
this.opts = options;
}
// options(options: FFmpegOutputOptions): void;
// options(): FFmpegOutputOptions;
// options(options?: FFmpegOutputOptions): FFmpegOutputOptions | void {
// if (options) {
// Object.assign(this.opts, options);
// } else {
// return this.opts;
// }
// }
clone(): FFmpegOutputParameters {
return new FFmpegOutputParameters().merge(this);
}
}