@UnstableApi
public final class Effects


Effects to apply to a MediaItem or to a Composition.

Summary

Constants

static final Effects

An empty Effects instance.

Public fields

final ImmutableList<AudioProcessor>

The list of audio processors to apply to audio buffers.

final ImmutableList<Effect>

The list of video effects to apply to each frame.

Public constructors

Effects(
    List<AudioProcessor> audioProcessors,
    List<Effect> videoEffects
)

Creates an instance.

Public methods

static Pair<AudioProcessorEffect>

Creates an interlinked audio processor and video effect that changes the speed to media samples in segments of the input file specified by the given SpeedProvider.

Constants

EMPTY

public static final Effects EMPTY

An empty Effects instance.

Public fields

audioProcessors

public final ImmutableList<AudioProcessoraudioProcessors

The list of audio processors to apply to audio buffers. They are applied in the order of the list, and buffers will only be modified by that if it isActive based on the current configuration.

videoEffects

public final ImmutableList<EffectvideoEffects

The list of video effects to apply to each frame. They are applied in the order of the list.

Public constructors

Effects

public Effects(
    List<AudioProcessor> audioProcessors,
    List<Effect> videoEffects
)

Creates an instance.

Parameters
List<AudioProcessor> audioProcessors

The audioProcessors.

List<Effect> videoEffects

The videoEffects.

Public methods

createExperimentalSpeedChangingEffect

public static Pair<AudioProcessorEffectcreateExperimentalSpeedChangingEffect(SpeedProvider speedProvider)

Creates an interlinked audio processor and video effect that changes the speed to media samples in segments of the input file specified by the given SpeedProvider.

The audio processor and video effect are interlinked to help maintain A/V sync. When using Transformer, if the input file doesn't have audio, or audio is being removed, you may have to force an audio track for the interlinked effects to function correctly. Alternatively, you can use SpeedChangeEffect when input has no audio.

Parameters
SpeedProvider speedProvider

The SpeedProvider determining the speed for the media at specific timestamps.