BaseInput
, BaseOutput
public abstract class BaseInOut<T extends BaseInOut> extends Object
Constructor | Description |
---|---|
BaseInOut() |
Modifier and Type | Method | Description |
---|---|---|
T |
addArgument(String argument) |
Add custom argument.
|
T |
addArguments(String key,
String value) |
Add custom arguments.
|
abstract List<String> |
buildArguments() |
|
protected List<String> |
buildCommonArguments() |
|
T |
setCodec(StreamType type,
String codecName) |
|
T |
setCodec(String streamSpecifier,
String codecName) |
|
T |
setDuration(long durationMillis) |
When used as an input option, limit the duration of data read from the input file.
|
T |
setDuration(long duration,
TimeUnit timeUnit) |
|
T |
setFormat(String format) |
Force input or output file format.
|
T |
setFrameRate(Number value) |
Set frame rate.
|
T |
setFrameRate(String streamSpecifier,
Number value) |
Set frame rate.
|
T |
setFrameSize(Number width,
Number height) |
Set frame size
|
T |
setFrameSize(String streamSpecifier,
Number width,
Number height) |
Set frame size
|
T |
setFrameSize(String streamSpecifier,
String resolution) |
Set frame size
|
T |
setPixelFormat(String format) |
|
T |
setPixelFormat(String streamSpecifier,
String value) |
|
T |
setPosition(long positionMillis) |
When used as an input option, seeks in this input file to position.
|
T |
setPosition(long position,
TimeUnit unit) |
|
T |
setPositionEof(long positionEofMillis) |
Like the
setPosition(long) (-ss) option but relative to the "end of file". |
T |
setPositionEof(long positionEof,
TimeUnit unit) |
Like the
setPositionEof(long) (-ss) option but relative to the "end of file". |
protected T |
thisAsT() |
|
protected static List<String> |
toArguments(String key,
Map<String,Object> args) |
public T setFormat(String format)
format
- formatpublic T setDuration(long durationMillis)
When used as an output option, stop writing the output after its duration reaches duration.
durationMillis
- duration in millisecondspublic T setDuration(long duration, TimeUnit timeUnit)
duration
- durationtimeUnit
- unit of durationsetDuration(long)
public T setPosition(long positionMillis)
Note that in most formats it is not possible to seek exactly, so ffmpeg will seek to the closest seek point before position. When transcoding and -accurate_seek is enabled (the default), this extra segment between the seek point and position will be decoded and discarded. When doing stream copy or when -noaccurate_seek is used, it will be preserved.
When used as an output option (before an output url), decodes but discards input until the timestamps reach position.
positionMillis
- position in milliseconds.public T setPosition(long position, TimeUnit unit)
position
- position.unit
- time unitsetPosition(long)
public T setPositionEof(long positionEofMillis)
setPosition(long)
(-ss) option but relative to the "end of file".
That is negative values are earlier in the file, 0 is at EOF.positionEofMillis
- position in milliseconds, relative to the EOFpublic T setPositionEof(long positionEof, TimeUnit unit)
setPositionEof(long)
(-ss) option but relative to the "end of file".
That is negative values are earlier in the file, 0 is at EOF.positionEof
- position, relative to the EOFunit
- time unitsetPositionEof(long)
public T setFrameRate(Number value)
As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps.
As an output option, duplicate or drop input frames to achieve constant output frame rate fps.
value
- Hz value, fraction or abbreviationpublic T setFrameRate(String streamSpecifier, Number value)
As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps.
As an output option, duplicate or drop input frames to achieve constant output frame rate fps.
streamSpecifier
- stream specifiervalue
- Hz value, fraction or abbreviationpublic T setFrameSize(Number width, Number height)
As an input option, this is a shortcut for the video_size private option, recognized by some demuxers for which the frame size is either not stored in the file or is configurable
As an output option, this inserts the scale video filter to the end of the corresponding filtergraph.
width
- frame widthheight
- frame heightpublic T setFrameSize(String streamSpecifier, Number width, Number height)
As an input option, this is a shortcut for the video_size private option, recognized by some demuxers for which the frame size is either not stored in the file or is configurable
As an output option, this inserts the scale video filter to the end of the corresponding filtergraph.
streamSpecifier
- stream specifierwidth
- frame widthheight
- frame heightpublic T setFrameSize(String streamSpecifier, String resolution)
As an input option, this is a shortcut for the video_size private option, recognized by some demuxers for which the frame size is either not stored in the file or is configurable
As an output option, this inserts the scale video filter to the end of the corresponding filtergraph.
streamSpecifier
- stream specifierresolution
- width + "x" + heightpublic T setCodec(StreamType type, String codecName)
public T addArguments(String key, String value)
key
- key to addvalue
- value to addpublic T addArgument(String argument)
argument
- argument to addprotected final T thisAsT()
Copyright © 2018. All rights reserved.