-
- All Implemented Interfaces:
-
com.otaliastudios.transcoder.strategy.TrackStrategy
public class DefaultVideoStrategy implements TrackStrategy
An TrackStrategy for video that converts it AVC with the given size. The input and output aspect ratio must match.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDefaultVideoStrategy.OptionsHolds configuration values.
public classDefaultVideoStrategy.Builder
-
Field Summary
Fields Modifier and Type Field Description public final static longBITRATE_UNKNOWNpublic final static floatDEFAULT_KEY_FRAME_INTERVALpublic final static intDEFAULT_FRAME_RATE
-
Constructor Summary
Constructors Constructor Description DefaultVideoStrategy(DefaultVideoStrategy.Options options)
-
Method Summary
Modifier and Type Method Description static DefaultVideoStrategy.Builderexact(int firstSize, int secondSize)Creates a new Builder with an ExactResizer using given dimensions. static DefaultVideoStrategy.Builderfraction(float fraction)Creates a new Builder with a FractionResizer using given downscale fraction. static DefaultVideoStrategy.BuilderaspectRatio(float aspectRatio)Creates a new Builder with a AspectRatioResizer using given aspect ratio value. static DefaultVideoStrategy.BuilderatMost(int atMostSize)Creates a new Builder with an AtMostResizer using given constraint. static DefaultVideoStrategy.BuilderatMost(int atMostMinor, int atMostMajor)Creates a new Builder with an AtMostResizer using given constraints. TrackStatuscreateOutputFormat(@NonNull() List<MediaFormat> inputFormats, @NonNull() MediaFormat outputFormat)Create the output format for this track (either audio or video). -
-
Constructor Detail
-
DefaultVideoStrategy
DefaultVideoStrategy(DefaultVideoStrategy.Options options)
-
-
Method Detail
-
exact
@NonNull() static DefaultVideoStrategy.Builder exact(int firstSize, int secondSize)
Creates a new Builder with an ExactResizer using given dimensions.
- Parameters:
firstSize- the exact first sizesecondSize- the exact second size
-
fraction
@NonNull() static DefaultVideoStrategy.Builder fraction(float fraction)
Creates a new Builder with a FractionResizer using given downscale fraction.
- Parameters:
fraction- the downscale fraction
-
aspectRatio
@NonNull() static DefaultVideoStrategy.Builder aspectRatio(float aspectRatio)
Creates a new Builder with a AspectRatioResizer using given aspect ratio value.
- Parameters:
aspectRatio- the desired aspect ratio
-
atMost
@NonNull() static DefaultVideoStrategy.Builder atMost(int atMostSize)
Creates a new Builder with an AtMostResizer using given constraint.
- Parameters:
atMostSize- size constraint
-
atMost
@NonNull() static DefaultVideoStrategy.Builder atMost(int atMostMinor, int atMostMajor)
Creates a new Builder with an AtMostResizer using given constraints.
- Parameters:
atMostMinor- constraint for the minor dimensionatMostMajor- constraint for the major dimension
-
createOutputFormat
@NonNull() TrackStatus createOutputFormat(@NonNull() List<MediaFormat> inputFormats, @NonNull() MediaFormat outputFormat)
Create the output format for this track (either audio or video).Implementors should fill the outputFormat object and return a non-null TrackStatus:- COMPRESSING: we want to compress this track. Output format will be used- PASS_THROUGH: we want to use the input format. Output format will be ignored- REMOVING: we want to remove this track. Output format will be ignoredSubclasses can also throw to abort the whole transcoding operation.
- Parameters:
inputFormats- the input formatsoutputFormat- the output format to be filled
-
-
-
-