@@ -28,6 +28,7 @@ public class ArchiveProperties {
2828 private String multiArchiveTag ;
2929 private boolean hasAudio ;
3030 private boolean hasVideo ;
31+ private Integer maxBitrate ;
3132 private OutputMode outputMode ;
3233 private StreamMode streamMode ;
3334 private ArchiveLayout layout ;
@@ -37,6 +38,7 @@ private ArchiveProperties(Builder builder) {
3738 this .resolution = builder .resolution ;
3839 this .hasAudio = builder .hasAudio ;
3940 this .hasVideo = builder .hasVideo ;
41+ this .maxBitrate = builder .maxBitrate ;
4042 this .outputMode = builder .outputMode ;
4143 this .streamMode = builder .streamMode ;
4244 this .layout = builder .layout ;
@@ -54,6 +56,7 @@ public static class Builder {
5456 private String multiArchiveTag = null ;
5557 private boolean hasAudio = true ;
5658 private boolean hasVideo = true ;
59+ private Integer maxBitrate ;
5760 private OutputMode outputMode = OutputMode .COMPOSED ;
5861 private StreamMode streamMode = StreamMode .AUTO ;
5962 private ArchiveLayout layout = null ;
@@ -112,6 +115,19 @@ public Builder hasVideo(boolean hasVideo) {
112115 return this ;
113116 }
114117
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+
115131 /**
116132 * Sets the output mode for this archive.
117133 *
@@ -221,6 +237,16 @@ public boolean hasAudio() {
221237 return hasAudio ;
222238 }
223239
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+
224250 /**
225251 * The output mode of the archive.
226252 */
@@ -246,43 +272,49 @@ public ArchiveLayout layout() {
246272 public Map <String , Collection <String >> toMap () {
247273 Map <String , Collection <String >> params = new HashMap <>();
248274 if (name != null ) {
249- ArrayList <String > valueList = new ArrayList <>();
275+ ArrayList <String > valueList = new ArrayList <>(1 );
250276 valueList .add (name );
251277 params .put ("name" , valueList );
252278 }
253279 if (resolution != null ) {
254- ArrayList <String > valueList = new ArrayList <>();
280+ ArrayList <String > valueList = new ArrayList <>(1 );
255281 valueList .add (resolution );
256282 params .put ("resolution" , valueList );
257283 }
258- ArrayList <String > valueList = new ArrayList <>();
284+ ArrayList <String > valueList = new ArrayList <>(1 );
259285 valueList .add (Boolean .toString (hasAudio ));
260286 params .put ("hasAudio" , valueList );
261287
262- valueList = new ArrayList <>();
288+ valueList = new ArrayList <>(1 );
263289 valueList .add (Boolean .toString (hasVideo ));
264290 params .put ("hasVideo" , valueList );
265291
266- valueList = new ArrayList <>();
292+ valueList = new ArrayList <>(1 );
267293 valueList .add (outputMode .toString ());
268294 params .put ("outputMode" , valueList );
269295
270- valueList = new ArrayList <>();
296+ valueList = new ArrayList <>(1 );
271297 valueList .add (streamMode .toString ());
272298 params .put ("streamMode" , valueList );
273299
274300 if (layout != null ) {
275- valueList = new ArrayList <>();
301+ valueList = new ArrayList <>(1 );
276302 valueList .add (layout .toString ());
277303 params .put ("layout" , valueList );
278304 }
279305
280306 if (multiArchiveTag != null ) {
281- valueList = new ArrayList <>();
307+ valueList = new ArrayList <>(1 );
282308 valueList .add (multiArchiveTag );
283309 params .put ("multiArchiveTag" , valueList );
284310 }
285311
312+ if (maxBitrate != null ) {
313+ valueList = new ArrayList <>(1 );
314+ valueList .add (maxBitrate .toString ());
315+ params .put ("maxBitrate" , valueList );
316+ }
317+
286318 return params ;
287319 }
288320
0 commit comments