-
Notifications
You must be signed in to change notification settings - Fork 20
/
output_setters.go
180 lines (129 loc) · 3.63 KB
/
output_setters.go
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
package fluentffmpeg
import "io"
// AspectRatio gets the aspect ratio.
// Ex: "16:9"
func (c *Command) AspectRatio(v string) *Command {
c.Args.output.aspectRatio = v
return c
}
// Resolution gets the resolution of the media. Ex: "100x100"
func (c *Command) Resolution(v string) *Command {
c.Args.output.resolution = v
return c
}
// ConstantRateFactor sets the constant rate factor (CRF) for video encoding
func (c *Command) ConstantRateFactor(v int) *Command {
c.Args.output.constantRateFactor = v
return c
}
// VideoBitRate gets the video bit rate.
func (c *Command) VideoBitRate(v int) *Command {
c.Args.output.videoBitRate = v
return c
}
// VideoMaxBitrate gets the max bit rate for the video.
func (c *Command) VideoMaxBitrate(v int) *Command {
c.Args.output.videoMaxBitrate = v
return c
}
// VideoMinBitrate gets the max bit rate for the video.
func (c *Command) VideoMinBitrate(v int) *Command {
c.Args.output.videoMinBitrate = v
return c
}
// VideoBitRateTolerance gets the video bit rate tolerance.
func (c *Command) VideoBitRateTolerance(v int) *Command {
c.Args.output.videoBitRateTolerance = v
return c
}
// VideoCodec gets the desired video codec when working with video.
func (c *Command) VideoCodec(v string) *Command {
c.Args.output.videoCodec = v
return c
}
// VFrames sets the number of frames to output
func (c *Command) VFrames(v int) *Command {
c.Args.output.vFrames = v
return c
}
// FrameRate sets the frames per second
func (c *Command) FrameRate(v int) *Command {
c.Args.output.frameRate = v
return c
}
// AudioRate sets the audio sampling rate
func (c *Command) AudioRate(v int) *Command {
c.Args.output.audioRate = v
return c
}
// AudioBitRate sets the audio bit rate
func (c *Command) AudioBitRate(v int) *Command {
c.Args.output.audioBitrate = v
return c
}
// NativeFramerateInput sets the native frame rate
func (c *Command) NativeFramerateInput(v bool) *Command {
c.Args.input.nativeFramerateInput = v
return c
}
// Preset sets the preset
func (c *Command) Preset(v string) *Command {
c.Args.output.preset = v
return c
}
// BufferSize sets the buffer size
func (c *Command) BufferSize(v int) *Command {
c.Args.output.bufferSize = v
return c
}
// PixelFormat sets the pixel format.
func (c *Command) PixelFormat(v string) *Command {
c.Args.output.pixelFormat = v
return c
}
// KeyframeInterval sets the keyframe interval.
func (c *Command) KeyframeInterval(v int) *Command {
c.Args.output.keyframeInterval = v
return c
}
// AudioCodec sets the audio codec to use
func (c *Command) AudioCodec(v string) *Command {
c.Args.output.audioCodec = v
return c
}
// AudioChannels sets the number of audio channels to use.
func (c *Command) AudioChannels(v int) *Command {
c.Args.output.audioChannels = v
return c
}
// OutputFormat sets the format of the output
func (c *Command) OutputFormat(v string) *Command {
c.Args.output.format = v
return c
}
// Quality sets the quality
func (c *Command) Quality(v int) *Command {
c.Args.output.quality = v
return c
}
// OutputPath sets the path to write the output file
func (c *Command) OutputPath(v string) *Command {
c.Args.output.outputPath = v
return c
}
// PipeOutput sets the output to be written to an io.Writer
func (c *Command) PipeOutput(output io.Writer) *Command {
c.Args.output.pipeOutput = output != nil
c.output = output
return c
}
// Overwrite configures FFmpeg to overwrite existing files
func (c *Command) Overwrite(b bool) *Command {
c.Args.output.overwrite = b
return c
}
// OutputOptions sets additional output options
func (c *Command) OutputOptions(options ...string) *Command {
c.Args.output.outputOptions = options
return c
}