Package net.bramp.ffmpeg.builder
Class AbstractFFmpegOutputBuilder<T extends AbstractFFmpegOutputBuilder<T>>
java.lang.Object
net.bramp.ffmpeg.builder.AbstractFFmpegStreamBuilder<T>
net.bramp.ffmpeg.builder.AbstractFFmpegOutputBuilder<T>
- Direct Known Subclasses:
FFmpegHlsOutputBuilder,FFmpegOutputBuilder
public abstract class AbstractFFmpegOutputBuilder<T extends AbstractFFmpegOutputBuilder<T>>
extends AbstractFFmpegStreamBuilder<T>
Builds a representation of a single output/encoding setting.
-
Field Summary
FieldsModifier and TypeFieldDescriptionlongDeprecated.Deprecated.UsegetVideoBitStreamFilter()instead.Deprecated.UsegetAudioFilter()instead.Deprecated.UsegetAudioQuality()instead.Deprecated.UsegetAudioSampleFormat()instead.protected IntegerSpecifies the number of b-frames ffmpeg is allowed to use. 0 will disable b-frames, null will let ffmpeg decide.protected StringDeprecated.UsegetConstantRateFactor()instead.longDeprecated.UsegetVideoBitRate()instead.Deprecated.UsegetVideoBitStreamFilter()instead.Deprecated.UsegetVideoFilter()instead.Deprecated.UsegetVideoPreset()instead.Deprecated.UsegetVideoQuality()instead.Fields inherited from class net.bramp.ffmpeg.builder.AbstractFFmpegStreamBuilder
audio_channels, audio_codec, audio_enabled, audio_preset, audio_sample_rate, DEVNULL, duration, extra_args, filename, format, maps, meta_tags, pass_padding_bitrate, preset, presetFilename, startOffset, strict, subtitle_enabled, subtitle_preset, targetSize, throwWarnings, uri, video_codec, video_copyinkf, video_enabled, video_frame_rate, video_frames, video_height, video_movflags, video_pixel_format, video_size, video_width -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs a default output builder.protectedAbstractFFmpegOutputBuilder(FFmpegBuilder parent, String filename) Constructs an output builder with the given parent and filename.protectedAbstractFFmpegOutputBuilder(FFmpegBuilder parent, URI uri) Constructs an output builder with the given parent and URI. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAudioFlags(com.google.common.collect.ImmutableList.Builder<String> args) Adds audio-related flags such as codec, channels, and sample rate to the arguments.protected voidaddGlobalFlags(FFmpegBuilder parent, com.google.common.collect.ImmutableList.Builder<String> args) Adds global flags such as format, preset, and time options to the arguments.protected voidaddSourceTarget(int pass, com.google.common.collect.ImmutableList.Builder<String> args) Adds source and target specific arguments for the given pass.protected voidaddVideoFlags(FFmpegBuilder parent, com.google.common.collect.ImmutableList.Builder<String> args) Adds video-related flags such as codec, frame rate, and resolution to the arguments.build(int pass) Builds the command-line arguments for the given pass using the parent builder.build(FFmpegBuilder parent, int pass) Builds the arguments.Returns a representation of this Builder that can be safely serialised.protected static StringformatDecimalInteger(double d) Returns a double formatted as a string.longprotected TgetThis()Returns this instance for fluent API chaining.longfinal TsetAudioBitDepth(String bit_depth) Deprecated.usesetAudioSampleFormat(java.lang.String)instead.setAudioBitRate(long bit_rate) Sets the Audio bit rate.setAudioBitStreamFilter(String filter) Sets the audio bitstream filter.setAudioFilter(String filter) Sets Audio Filter.setAudioQuality(double quality) Sets the audio quality factor.setAudioSampleFormat(String sample_format) Sets the audio sample format.setBFrames(int bFrames) Sets the number of b-frames ffmpeg is allowed to use. 0 means: Do not use b-frames at allsetComplexFilter(String filter) Sets a complex filtergraph.setConstantRateFactor(double factor) Sets the constant rate factor (CRF) for encoding quality.setVideoBitRate(long bit_rate) Sets the video bit rate in bits per second.setVideoBitStreamFilter(String filter) Sets the video bit stream filter.setVideoFilter(String filter) Sets Video Filter.setVideoPreset(String preset) Sets a video preset to use.setVideoQuality(double quality) Sets the video quality factor.Methods inherited from class net.bramp.ffmpeg.builder.AbstractFFmpegStreamBuilder
addExtraArgs, addFormatArgs, addMap, addMap, addMetaTag, addMetaTag, disableAudio, disableSubtitle, disableVideo, done, getFilename, getUri, isValidSize, setAudioChannels, setAudioCodec, setAudioPreset, setAudioSampleRate, setDuration, setFilename, setFilename, setFilename, setFormat, setFrames, setPassPaddingBitrate, setPreset, setPresetFilename, setPresetFilename, setPresetFilename, setStartOffset, setStrict, setSubtitleCodec, setSubtitlePreset, setTargetSize, setUri, setVideoCodec, setVideoCopyInkf, setVideoFrameRate, setVideoFrameRate, setVideoFrameRate, setVideoHeight, setVideoMovFlags, setVideoPixelFormat, setVideoResolution, setVideoResolution, setVideoWidth, useOptions, useOptions, useOptions, useOptions
-
Field Details
-
constantRateFactor
Deprecated.UsegetConstantRateFactor()instead.The constant rate factor (CRF). -
audio_sample_format
Deprecated.UsegetAudioSampleFormat()instead.The audio sample format. -
audio_bit_rate
Deprecated.UsegetAudioBitRate()instead.The audio bit rate. -
audio_quality
Deprecated.UsegetAudioQuality()instead.The audio quality. -
audio_bit_stream_filter
Deprecated.UsegetVideoBitStreamFilter()instead.The audio bitstream filter. -
audio_filter
Deprecated.UsegetAudioFilter()instead.The audio filter string. -
video_bit_rate
Deprecated.UsegetVideoBitRate()instead.The video bit rate. -
video_quality
Deprecated.UsegetVideoQuality()instead.The video quality. -
video_preset
Deprecated.UsegetVideoPreset()instead.The video encoding preset. -
video_filter
Deprecated.UsegetVideoFilter()instead.The video filter string. -
video_bit_stream_filter
Deprecated.UsegetVideoBitStreamFilter()instead.The video bitstream filter. -
bFrames
Specifies the number of b-frames ffmpeg is allowed to use. 0 will disable b-frames, null will let ffmpeg decide. -
complexFilter
-
-
Constructor Details
-
AbstractFFmpegOutputBuilder
public AbstractFFmpegOutputBuilder()Constructs a default output builder. -
AbstractFFmpegOutputBuilder
Constructs an output builder with the given parent and filename. -
AbstractFFmpegOutputBuilder
Constructs an output builder with the given parent and URI.
-
-
Method Details
-
setConstantRateFactor
Sets the constant rate factor (CRF) for encoding quality. -
setVideoBitRate
Sets the video bit rate in bits per second. -
setVideoQuality
Sets the video quality factor. -
setVideoBitStreamFilter
Sets the video bit stream filter. -
setVideoPreset
Sets a video preset to use.Uses `-vpre`.
- Parameters:
preset- the preset- Returns:
- this
-
setBFrames
Sets the number of b-frames ffmpeg is allowed to use. 0 means: Do not use b-frames at all- Parameters:
bFrames- number of b-frames- Returns:
- this
-
setVideoFilter
Sets Video Filter.TODO Build a fluent Filter builder
- Parameters:
filter- The video filter.- Returns:
- this
-
setAudioBitDepth
@Deprecated @InlineMe(replacement="this.setAudioSampleFormat(bit_depth)") public final T setAudioBitDepth(String bit_depth) Deprecated.usesetAudioSampleFormat(java.lang.String)instead.Sets the audio bit depth.- Parameters:
bit_depth- The sample format, one of the net.bramp.ffmpeg.FFmpeg#AUDIO_DEPTH_* constants.- Returns:
- this
- See Also:
-
setAudioSampleFormat
Sets the audio sample format.- Parameters:
sample_format- The sample format, one of the net.bramp.ffmpeg.FFmpeg#AUDIO_FORMAT_* constants.- Returns:
- this
- See Also:
-
setAudioBitRate
Sets the Audio bit rate.- Parameters:
bit_rate- Audio bitrate in bits per second.- Returns:
- this
-
setAudioQuality
Sets the audio quality factor. -
setAudioBitStreamFilter
Sets the audio bitstream filter. -
setComplexFilter
Sets a complex filtergraph. -
setAudioFilter
Sets Audio Filter.TODO Build a fluent Filter builder
- Parameters:
filter- The audio filter.- Returns:
- this
-
buildOptions
Returns a representation of this Builder that can be safely serialised.NOTE: This method is horribly out of date, and its use should be rethought.
- Specified by:
buildOptionsin classAbstractFFmpegStreamBuilder<T extends AbstractFFmpegOutputBuilder<T>>- Returns:
- A new EncodingOptions capturing this Builder's state
-
build
Description copied from class:AbstractFFmpegStreamBuilderBuilds the command-line arguments for the given pass using the parent builder.- Overrides:
buildin classAbstractFFmpegStreamBuilder<T extends AbstractFFmpegOutputBuilder<T>>
-
build
Builds the arguments.- Overrides:
buildin classAbstractFFmpegStreamBuilder<T extends AbstractFFmpegOutputBuilder<T>>- Parameters:
parent- The parent FFmpegBuilderpass- The particular pass. For one-pass this value will be zero, for multi-pass, it will be 1 for the first pass, 2 for the second, and so on.- Returns:
- The arguments
-
formatDecimalInteger
Returns a double formatted as a string. If the double is an integer, then trailing zeros are striped.- Parameters:
d- the double to format.- Returns:
- The formatted double.
-
addGlobalFlags
protected void addGlobalFlags(FFmpegBuilder parent, com.google.common.collect.ImmutableList.Builder<String> args) Description copied from class:AbstractFFmpegStreamBuilderAdds global flags such as format, preset, and time options to the arguments.- Overrides:
addGlobalFlagsin classAbstractFFmpegStreamBuilder<T extends AbstractFFmpegOutputBuilder<T>>
-
addVideoFlags
protected void addVideoFlags(FFmpegBuilder parent, com.google.common.collect.ImmutableList.Builder<String> args) Description copied from class:AbstractFFmpegStreamBuilderAdds video-related flags such as codec, frame rate, and resolution to the arguments.- Overrides:
addVideoFlagsin classAbstractFFmpegStreamBuilder<T extends AbstractFFmpegOutputBuilder<T>>
-
addAudioFlags
Description copied from class:AbstractFFmpegStreamBuilderAdds audio-related flags such as codec, channels, and sample rate to the arguments.- Overrides:
addAudioFlagsin classAbstractFFmpegStreamBuilder<T extends AbstractFFmpegOutputBuilder<T>>
-
addSourceTarget
protected void addSourceTarget(int pass, com.google.common.collect.ImmutableList.Builder<String> args) Description copied from class:AbstractFFmpegStreamBuilderAdds source and target specific arguments for the given pass.- Specified by:
addSourceTargetin classAbstractFFmpegStreamBuilder<T extends AbstractFFmpegOutputBuilder<T>>
-
getThis
Description copied from class:AbstractFFmpegStreamBuilderReturns this instance for fluent API chaining.- Specified by:
getThisin classAbstractFFmpegStreamBuilder<T extends AbstractFFmpegOutputBuilder<T>>
-
getConstantRateFactor
-
getAudioSampleFormat
-
getAudioBitRate
-
getAudioQuality
-
getAudioBitStreamFilter
-
getAudioFilter
-
getVideoBitRate
-
getVideoQuality
-
getVideoPreset
-
getVideoFilter
-
getVideoBitStreamFilter
-
getComplexFilter
-
getAudioBitRate()instead.