public static class TranscoderOptions.Builder
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
TranscoderOptions.Builder |
addDataSource(android.content.Context context,
android.net.Uri uri) |
TranscoderOptions.Builder |
addDataSource(DataSource dataSource) |
TranscoderOptions.Builder |
addDataSource(java.io.FileDescriptor fileDescriptor) |
TranscoderOptions.Builder |
addDataSource(java.lang.String inPath) |
TranscoderOptions.Builder |
addDataSource(TrackType type,
android.content.Context context,
android.net.Uri uri) |
TranscoderOptions.Builder |
addDataSource(TrackType type,
DataSource dataSource) |
TranscoderOptions.Builder |
addDataSource(TrackType type,
java.io.FileDescriptor fileDescriptor) |
TranscoderOptions.Builder |
addDataSource(TrackType type,
java.lang.String inPath) |
TranscoderOptions |
build() |
TranscoderOptions.Builder |
setAudioResampler(AudioResampler audioResampler)
Sets an
AudioResampler to change the sample rate of audio
frames when sample rate conversion is needed. |
TranscoderOptions.Builder |
setAudioStretcher(AudioStretcher audioStretcher)
Sets an
AudioStretcher to perform stretching of audio samples
as a consequence of speed and time interpolator changes. |
TranscoderOptions.Builder |
setAudioTrackStrategy(TrackStrategy trackStrategy)
Sets the audio output strategy.
|
TranscoderOptions.Builder |
setListener(TranscoderListener listener) |
TranscoderOptions.Builder |
setListenerHandler(android.os.Handler listenerHandler)
Sets an handler for
TranscoderListener callbacks. |
TranscoderOptions.Builder |
setSpeed(float speedFactor)
Shorthand for calling
setTimeInterpolator(TimeInterpolator)
and passing a SpeedTimeInterpolator. |
TranscoderOptions.Builder |
setTimeInterpolator(TimeInterpolator timeInterpolator)
Sets a
TimeInterpolator to change the frames timestamps - either video or
audio or both - before they are written into the output file. |
TranscoderOptions.Builder |
setValidator(Validator validator)
Sets a validator to understand whether the transcoding process should
stop before being started, based on the tracks status.
|
TranscoderOptions.Builder |
setVideoRotation(int rotation)
The clockwise rotation to be applied to the input video frames.
|
TranscoderOptions.Builder |
setVideoTrackStrategy(TrackStrategy trackStrategy)
Sets the video output strategy.
|
java.util.concurrent.Future<java.lang.Void> |
transcode() |
@NonNull public TranscoderOptions.Builder addDataSource(@NonNull DataSource dataSource)
@NonNull public TranscoderOptions.Builder addDataSource(@NonNull TrackType type, @NonNull DataSource dataSource)
@NonNull public TranscoderOptions.Builder addDataSource(@NonNull java.io.FileDescriptor fileDescriptor)
@NonNull public TranscoderOptions.Builder addDataSource(@NonNull TrackType type, @NonNull java.io.FileDescriptor fileDescriptor)
@NonNull public TranscoderOptions.Builder addDataSource(@NonNull java.lang.String inPath)
@NonNull public TranscoderOptions.Builder addDataSource(@NonNull TrackType type, @NonNull java.lang.String inPath)
@NonNull public TranscoderOptions.Builder addDataSource(@NonNull android.content.Context context, @NonNull android.net.Uri uri)
@NonNull public TranscoderOptions.Builder addDataSource(@NonNull TrackType type, @NonNull android.content.Context context, @NonNull android.net.Uri uri)
@NonNull public TranscoderOptions.Builder setAudioTrackStrategy(@Nullable TrackStrategy trackStrategy)
DefaultAudioStrategy.trackStrategy - the desired strategy@NonNull public TranscoderOptions.Builder setVideoTrackStrategy(@Nullable TrackStrategy trackStrategy)
DefaultVideoStrategies.for720x1280().trackStrategy - the desired strategy@NonNull public TranscoderOptions.Builder setListener(@NonNull TranscoderListener listener)
@NonNull public TranscoderOptions.Builder setListenerHandler(@Nullable android.os.Handler listenerHandler)
TranscoderListener callbacks.
If null, this will default to the thread that starts the transcoding, if it
has a looper, or the UI thread otherwise.listenerHandler - the thread to receive callbacks@NonNull public TranscoderOptions.Builder setValidator(@Nullable Validator validator)
DefaultValidator.validator - the validator@NonNull public TranscoderOptions.Builder setVideoRotation(int rotation)
rotation - either 0, 90, 180 or 270@NonNull public TranscoderOptions.Builder setTimeInterpolator(@NonNull TimeInterpolator timeInterpolator)
TimeInterpolator to change the frames timestamps - either video or
audio or both - before they are written into the output file.
Defaults to DefaultTimeInterpolator.timeInterpolator - a time interpolator@NonNull public TranscoderOptions.Builder setSpeed(float speedFactor)
setTimeInterpolator(TimeInterpolator)
and passing a SpeedTimeInterpolator.
This interpolator can modify the video speed by the given factor.speedFactor - a factor, greather than 0@NonNull public TranscoderOptions.Builder setAudioStretcher(@NonNull AudioStretcher audioStretcher)
AudioStretcher to perform stretching of audio samples
as a consequence of speed and time interpolator changes.
Defaults to DefaultAudioStretcher.audioStretcher - an audio stretcher@NonNull public TranscoderOptions.Builder setAudioResampler(@NonNull AudioResampler audioResampler)
AudioResampler to change the sample rate of audio
frames when sample rate conversion is needed. Upsampling is discouraged.
Defaults to DefaultAudioResampler.audioResampler - an audio resampler@NonNull public TranscoderOptions build()
@NonNull public java.util.concurrent.Future<java.lang.Void> transcode()