Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chemicalbird/ExoPlayerTimelineView

Extracts video frames using ExoPlayer and show as a video timeline(FixedView, ScrollView)
https://github.com/chemicalbird/ExoPlayerTimelineView

android android-custom-view android-video exo-player exoplayer glsurfaceview opengl-es recyclerview timeline-view video-preview

Last synced: about 2 months ago
JSON representation

Extracts video frames using ExoPlayer and show as a video timeline(FixedView, ScrollView)

Awesome Lists containing this project

README

        

# ExoPlayerTimelineView

If you already use ExoPlayer in your project and need to extract video
frames and show them as a **timeline view** either scrollable or in a
fixed-width mode then you're in the right place.



You might already be familiar with `MediaMetadataRetriever` api and its
`getFrameAtTime(..)` method, I included adapter implementation(it's not
meant for production use) for comparison with `RetroInstance` API, which
caches frames internally and won't init any mediaCodec resource if
unnecessary. And it's running significantly faster.

### Installation
Add this to your application module, inside *dependencies* block.
```sh
dependencies {
implementation 'com.chemicalbird.android:videotimelineview:0.0.4'
}
```

### Usage example

1. For fixed frame list there is already an implementation of
`GLSurfaceView` that you can use out of the box. Your layout and code
goes like this.

```sh

```
```sh
VideoTimeLine.with(fileUri).show(glSurfaceView);
```

2. To create a frame grabber MediaRetriever implementation use
`RetroInstance`, for example pass it to your RecyclerView.Adapter. To
get a frame at specific time call
`retroInstance.load(presentationTime, callback)`. Checkout Sample
project for more details.

```sh
RetroInstance retroInstance = new RetroInstance.Builder(context, mediaUri).setFrameSizeDp(180).create();

// in adapter
retroInstance.load(position * frameDuration, holder.hashCode(),
file -> imageLoader.load(file, imageView));
```