public class DefaultVideoStrategy extends java.lang.Object implements TrackStrategy
TrackStrategy for video that converts it AVC with the given size.
The input and output aspect ratio must match.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultVideoStrategy.Builder |
static class |
DefaultVideoStrategy.Options
Holds configuration values.
|
| Modifier and Type | Field and Description |
|---|---|
static long |
BITRATE_UNKNOWN |
static int |
DEFAULT_FRAME_RATE |
static float |
DEFAULT_KEY_FRAME_INTERVAL |
| Constructor and Description |
|---|
DefaultVideoStrategy(DefaultVideoStrategy.Options options) |
| Modifier and Type | Method and Description |
|---|---|
static DefaultVideoStrategy.Builder |
aspectRatio(float aspectRatio)
Creates a new
DefaultVideoStrategy.Builder with a AspectRatioResizer
using given aspect ratio value. |
static DefaultVideoStrategy.Builder |
atMost(int atMostSize)
Creates a new
DefaultVideoStrategy.Builder with an AtMostResizer
using given constraint. |
static DefaultVideoStrategy.Builder |
atMost(int atMostMinor,
int atMostMajor)
Creates a new
DefaultVideoStrategy.Builder with an AtMostResizer
using given constraints. |
TrackStatus |
createOutputFormat(java.util.List<android.media.MediaFormat> inputFormats,
android.media.MediaFormat outputFormat)
Create the output format for this track (either audio or video).
|
static DefaultVideoStrategy.Builder |
exact(int firstSize,
int secondSize)
Creates a new
DefaultVideoStrategy.Builder with an ExactResizer
using given dimensions. |
static DefaultVideoStrategy.Builder |
fraction(float fraction)
Creates a new
DefaultVideoStrategy.Builder with a FractionResizer
using given downscale fraction. |
public static final long BITRATE_UNKNOWN
public static final float DEFAULT_KEY_FRAME_INTERVAL
public static final int DEFAULT_FRAME_RATE
public DefaultVideoStrategy(@NonNull
DefaultVideoStrategy.Options options)
@NonNull public static DefaultVideoStrategy.Builder exact(int firstSize, int secondSize)
DefaultVideoStrategy.Builder with an ExactResizer
using given dimensions.firstSize - the exact first sizesecondSize - the exact second size@NonNull public static DefaultVideoStrategy.Builder fraction(float fraction)
DefaultVideoStrategy.Builder with a FractionResizer
using given downscale fraction.fraction - the downscale fraction@NonNull public static DefaultVideoStrategy.Builder aspectRatio(float aspectRatio)
DefaultVideoStrategy.Builder with a AspectRatioResizer
using given aspect ratio value.aspectRatio - the desired aspect ratio@NonNull public static DefaultVideoStrategy.Builder atMost(int atMostSize)
DefaultVideoStrategy.Builder with an AtMostResizer
using given constraint.atMostSize - size constraint@NonNull public static DefaultVideoStrategy.Builder atMost(int atMostMinor, int atMostMajor)
DefaultVideoStrategy.Builder with an AtMostResizer
using given constraints.atMostMajor - constraint for the major dimensionatMostMinor - constraint for the minor dimension@NonNull public TrackStatus createOutputFormat(@NonNull java.util.List<android.media.MediaFormat> inputFormats, @NonNull android.media.MediaFormat outputFormat)
TrackStrategyTrackStatus:
- TrackStatus.COMPRESSING: we want to compress this track. Output format will be used
- TrackStatus.PASS_THROUGH: we want to use the input format. Output format will be ignored
- TrackStatus.REMOVING: we want to remove this track. Output format will be ignored
Subclasses can also throw to abort the whole transcoding operation.createOutputFormat in interface TrackStrategyinputFormats - the input formatsoutputFormat - the output format to be filled