@@ -27,7 +27,7 @@ public abstract class AbstractFFmpegOutputBuilder<T extends AbstractFFmpegOutput
27
27
@ Deprecated
28
28
public Double constantRateFactor ;
29
29
30
- /** @deprecated Use {@link #getAudioSampleFormat ()} instead*/
30
+ /** @deprecated Use {@link #getAudioSamp leFormat ()} instead*/
31
31
@ Deprecated
32
32
public String audio_sample_format ;
33
33
@@ -67,6 +67,12 @@ public abstract class AbstractFFmpegOutputBuilder<T extends AbstractFFmpegOutput
67
67
@ Deprecated
68
68
public String video_bit_stream_filter ;
69
69
70
+ /**
71
+ * Specifies the number of b-frames ffmpeg is allowed to use.
72
+ * 0 will disable b-frames, null will let ffmpeg decide.
73
+ */
74
+ private Integer bFrames ;
75
+
70
76
public AbstractFFmpegOutputBuilder () {
71
77
super ();
72
78
}
@@ -118,6 +124,18 @@ public T setVideoPreset(String preset) {
118
124
return (T ) this ;
119
125
}
120
126
127
+ /**
128
+ * Sets the number of b-frames ffmpeg is allowed to use.
129
+ * 0 -> Do not use b-frames at all
130
+ *
131
+ * @param bFrames number of b-frames
132
+ * @return this
133
+ */
134
+ public T setBFrames (int bFrames ) {
135
+ this .bFrames = bFrames ;
136
+ return (T ) this ;
137
+ }
138
+
121
139
/**
122
140
* Sets Video Filter
123
141
*
@@ -349,6 +367,10 @@ protected void addVideoFlags(FFmpegBuilder parent, ImmutableList.Builder<String>
349
367
if (!Strings .isNullOrEmpty (video_bit_stream_filter )) {
350
368
args .add ("-bsf:v" , video_bit_stream_filter );
351
369
}
370
+
371
+ if (bFrames != null ) {
372
+ args .add ("-bf" , Integer .toString (bFrames ));
373
+ }
352
374
}
353
375
354
376
@ Override
0 commit comments