ExperimentalFrameExtractor


@UnstableApi
public final class ExperimentalFrameExtractor


Summary

Nested types

Configuration for the frame extractor.

A builder for Configuration instances.

Stores an extracted and decoded video frame.

Public constructors

Creates an instance.

Public methods

ListenableFuture<ExperimentalFrameExtractor.Frame>
getFrame(long positionMs)

Extracts a representative Frame for the specified video position using the SeekParameters specified in the Configuration.

ListenableFuture<ExperimentalFrameExtractor.Frame>
getFrame(long positionMs, SeekParameters seekParameters)

Extracts a representative Frame for the specified video position using the requested SeekParameters.

void

Releases the underlying resources.

void
setMediaItem(MediaItem mediaItem, List<Effect> effects)

Sets a new MediaItem.

Public constructors

ExperimentalFrameExtractor

public ExperimentalFrameExtractor(
    Context context,
    ExperimentalFrameExtractor.Configuration configuration
)

Creates an instance.

Parameters
Context context

Context.

ExperimentalFrameExtractor.Configuration configuration

The Configuration for this frame extractor.

Public methods

getFrame

public ListenableFuture<ExperimentalFrameExtractor.FramegetFrame(long positionMs)

Extracts a representative Frame for the specified video position using the SeekParameters specified in the Configuration.

Parameters
long positionMs

The time position in the MediaItem for which a frame is extracted, in milliseconds.

getFrame

public ListenableFuture<ExperimentalFrameExtractor.FramegetFrame(long positionMs, SeekParameters seekParameters)

Extracts a representative Frame for the specified video position using the requested SeekParameters.

Parameters
long positionMs

The time position in the MediaItem for which a frame is extracted, in milliseconds.

SeekParameters seekParameters

The SeekParameters.

release

public void release()

Releases the underlying resources. This method must be called when the frame extractor is no longer required. The frame extractor must not be used after calling this method.

setMediaItem

public void setMediaItem(MediaItem mediaItem, List<Effect> effects)

Sets a new MediaItem.

Changing between SDR and HDR MediaItems is not supported when extractHdrFrames is true.

Parameters
MediaItem mediaItem

The MediaItem from which frames will be extracted.

List<Effect> effects

The List of video effects to apply to the extracted video frames.