@@ -28,6 +28,7 @@ public class ArchiveProperties {
28
28
private String multiArchiveTag ;
29
29
private boolean hasAudio ;
30
30
private boolean hasVideo ;
31
+ private Integer maxBitrate ;
31
32
private OutputMode outputMode ;
32
33
private StreamMode streamMode ;
33
34
private ArchiveLayout layout ;
@@ -37,6 +38,7 @@ private ArchiveProperties(Builder builder) {
37
38
this .resolution = builder .resolution ;
38
39
this .hasAudio = builder .hasAudio ;
39
40
this .hasVideo = builder .hasVideo ;
41
+ this .maxBitrate = builder .maxBitrate ;
40
42
this .outputMode = builder .outputMode ;
41
43
this .streamMode = builder .streamMode ;
42
44
this .layout = builder .layout ;
@@ -54,6 +56,7 @@ public static class Builder {
54
56
private String multiArchiveTag = null ;
55
57
private boolean hasAudio = true ;
56
58
private boolean hasVideo = true ;
59
+ private Integer maxBitrate ;
57
60
private OutputMode outputMode = OutputMode .COMPOSED ;
58
61
private StreamMode streamMode = StreamMode .AUTO ;
59
62
private ArchiveLayout layout = null ;
@@ -112,6 +115,19 @@ public Builder hasVideo(boolean hasVideo) {
112
115
return this ;
113
116
}
114
117
118
+ /**
119
+ * Sets the maximum bitrate (bps) for the archive. Minimum is 100000, maximum is 6000000.
120
+ *
121
+ * @param maxBitrate The maximum bitrate (in bits per second) for the archiving.
122
+ *
123
+ * @return The ArchiveProperties.Builder object with the maxBitrate setting.
124
+ * @since 4.15.0
125
+ */
126
+ public Builder maxBitrate (int maxBitrate ) {
127
+ this .maxBitrate = maxBitrate ;
128
+ return this ;
129
+ }
130
+
115
131
/**
116
132
* Sets the output mode for this archive.
117
133
*
@@ -221,6 +237,16 @@ public boolean hasAudio() {
221
237
return hasAudio ;
222
238
}
223
239
240
+ /**
241
+ * Gets the maximum bitrate (bps) for the archive if specified.
242
+ *
243
+ * @return The maximum bitrate (in bits per second) for the archiving, or {@code null} if unspecified (the default).
244
+ * @since 4.15.0
245
+ */
246
+ public Integer maxBitrate () {
247
+ return maxBitrate ;
248
+ }
249
+
224
250
/**
225
251
* The output mode of the archive.
226
252
*/
@@ -246,43 +272,49 @@ public ArchiveLayout layout() {
246
272
public Map <String , Collection <String >> toMap () {
247
273
Map <String , Collection <String >> params = new HashMap <>();
248
274
if (name != null ) {
249
- ArrayList <String > valueList = new ArrayList <>();
275
+ ArrayList <String > valueList = new ArrayList <>(1 );
250
276
valueList .add (name );
251
277
params .put ("name" , valueList );
252
278
}
253
279
if (resolution != null ) {
254
- ArrayList <String > valueList = new ArrayList <>();
280
+ ArrayList <String > valueList = new ArrayList <>(1 );
255
281
valueList .add (resolution );
256
282
params .put ("resolution" , valueList );
257
283
}
258
- ArrayList <String > valueList = new ArrayList <>();
284
+ ArrayList <String > valueList = new ArrayList <>(1 );
259
285
valueList .add (Boolean .toString (hasAudio ));
260
286
params .put ("hasAudio" , valueList );
261
287
262
- valueList = new ArrayList <>();
288
+ valueList = new ArrayList <>(1 );
263
289
valueList .add (Boolean .toString (hasVideo ));
264
290
params .put ("hasVideo" , valueList );
265
291
266
- valueList = new ArrayList <>();
292
+ valueList = new ArrayList <>(1 );
267
293
valueList .add (outputMode .toString ());
268
294
params .put ("outputMode" , valueList );
269
295
270
- valueList = new ArrayList <>();
296
+ valueList = new ArrayList <>(1 );
271
297
valueList .add (streamMode .toString ());
272
298
params .put ("streamMode" , valueList );
273
299
274
300
if (layout != null ) {
275
- valueList = new ArrayList <>();
301
+ valueList = new ArrayList <>(1 );
276
302
valueList .add (layout .toString ());
277
303
params .put ("layout" , valueList );
278
304
}
279
305
280
306
if (multiArchiveTag != null ) {
281
- valueList = new ArrayList <>();
307
+ valueList = new ArrayList <>(1 );
282
308
valueList .add (multiArchiveTag );
283
309
params .put ("multiArchiveTag" , valueList );
284
310
}
285
311
312
+ if (maxBitrate != null ) {
313
+ valueList = new ArrayList <>(1 );
314
+ valueList .add (maxBitrate .toString ());
315
+ params .put ("maxBitrate" , valueList );
316
+ }
317
+
286
318
return params ;
287
319
}
288
320
0 commit comments