Fast Seek for ExoPlayer

Overview

Donation About Jan Rabe

FastExoPlayerSeeker Javadoc Build Status API Gradle Version kotlin Licence androidx

Introduction

Adds fast seeking for exoplayer. (Note: it also depends on the amount of video encoding, mainly IDR Frames)

demo

How to install

repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    implementation 'com.github.kibotu:FastExoPlayerSeeker:-SNAPSHOT'
}

How to use

Create Emitter

val emitter = SeekPositionEmitter()
emitter.seekFast(newSeekPosition)

Create Observable

simpleExoPlayer.seekWhenReady(emitter)
    .subscribe({
        logv("seekTo=${it.first} isSeeking=${it.second}")
    }, { loge("${it.message}") })
    .addTo(subscriptions) // don't forget to dispose when you're done!

FFMpeg

I've had good results increasing the amount if IDR frames using the following script which in term will help exoplayer snap to those sync frames and improve scrubbing.

#!/usr/bin/env bash
# change iframe rate
# https://gist.github.com/kibotu/27c5d665d19b9f782e6b4f26eff878b1
#
# https://ffmpeg.org/ffmpeg-formats.html#mov_002c-mp4_002c-ismv
# -movflags faststart
#  Run a second pass moving the index (moov atom) to the beginning of the file. This operation can take a while, and will not work in various situations such as fragmented output, thus it is not enabled by default.
#
# -movflags rtphint
#  Add RTP hinting tracks to the output file.
#
# -c:v libx264
# -c codec codec name
#
# -profile profile set profile
# Another optional setting is -profile:v which will limit the output to a specific H.264 profile.
# Omit this unless your target device only supports a certain profile (see Compatibility).
# Current profiles include: baseline, main, high, high10, high422, high444. Note that usage of -profile:v is incompatible with lossless encoding.
# https://trac.ffmpeg.org/wiki/Encode/H.264
# https://trac.ffmpeg.org/wiki/Encode/H.264#Compatibility
#
#  -keyint_min E..V…. minimum interval between IDR-frames (from INT_MIN to INT_MAX) (default 25)
ffmpeg -i inputvide.mp4 -c:v libx264 -profile:v baseline -level 3.0 -x264opts keyint=10:min-keyint=10 -g 10 -movflags +faststart+rtphint -maxrate:v 4000k -bufsize:v 4500k outputvideo.mp4

How to build

graldew clean build

CI

gradlew clean assembleRelease test javadoc

Build Requirements

  • JDK8
  • Android Build Tools 29.0.2
  • Android SDK 29

Notes

Follow me on Twitter: @wolkenschauer

Let me know what you think: [email protected]

Contributions welcome!

License

Copyright 2019 Jan Rabe

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
A simple time second selector seek bar custom made
A simple time second selector seek bar custom made

A simple time second selector seek bar custom made How to To get a Git project into your build: Step 1. Add the JitPack repository to your build file

Hide and seek revamped.
Hide and seek revamped.

TreasureFind TreasureFind is a modern ice breaker game ultilizing your inseparable companion (phone). You can play the game with a group of friends or

Simple and lightweight, yet polished and powerful Android video player based on ExoPlayer
Simple and lightweight, yet polished and powerful Android video player based on ExoPlayer

Just (Video) Player Android video player based on ExoPlayer It uses ExoPlayer's extension-ffmpeg with all its audio formats enabled (it can handle eve

Android podcast app made with Jetpack Compose and ExoPlayer.
Android podcast app made with Jetpack Compose and ExoPlayer.

Podcast App Android podcast app made with Jetpack Compose and ExoPlayer. Podcast information provided by Listen Notes API. Features Jetpack Compose UI

 AutoPlayer - A player based on ExoPlayer for play video automatically in RecyclerView, when an item is visible.
AutoPlayer - A player based on ExoPlayer for play video automatically in RecyclerView, when an item is visible.

A player based on ExoPlayer for play video automatically in RecyclerView, when an item is visible.

Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer.
Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer.

Yet Another Video Player Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer. Who Is YAVP For? First o

To show how to use preloading in exoplayer android using simple MVVM
To show how to use preloading in exoplayer android using simple MVVM

Instagram Preloading Tech Stack Kotlin ViewBinding ExoPlayer ViewModel Coroutine Glide for image Demo Please take a look at videos folder How to run C

The androidx.media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android

AndroidX Media AndroidX Media is a collection of libraries for implementing media use cases on Android, including local playback (via ExoPlayer) and m

Android SRT player powered by Exoplayer and srtdroid

SrtPlayer An Android SRT test player powered by ExoPayer. Most of this code comes from YoussefHenna reply in the SRT support ExoPayer issue. It demons

Sandbox project for practice: Media Streaming with Exoplayer (via Android Development tutorial)

Media streaming with ExoPlayer The code in this repository accompanies the Media streaming with ExoPlayer codelab. If you are looking to get started w

ExoPlayerComposeSample - Example for how we can use the ExoPlayer with Jetpack Compose

ExoPlayer Example with Jetpack Compose This repository demonstrates how we can u

Movies App by MVVM, Coroutines, Retrofit,, Navigation Component, ExoPlayer, Coil and Firebase
Movies App by MVVM, Coroutines, Retrofit,, Navigation Component, ExoPlayer, Coil and Firebase

Show-Time Movies App by MVVM, Coroutines, Retrofit, Navigation Component, ExoPlayer, Coil and Firebase Screens Home Movies Details Movies List Person

Compose-video-player - Video player for Android Compose powered by ExoPlayer

Compose Video Player Video player for Android Compose powered by ExoPlayer. Addi

ExoPlayer - an application level media player for Android
ExoPlayer - an application level media player for Android

ExoPlayer is an application level media player for Android. It provides an alternative to Android’s MediaPlayer API for playing audio and video both locally and over the Internet. ExoPlayer supports features not currently supported by Android’s MediaPlayer API, including DASH and SmoothStreaming adaptive playbacks.

This is a basic demo application for exoplayer library.
This is a basic demo application for exoplayer library.

ExoPlayer Demo Application This is a basic demo application for exoplayer library. It can stream these types of file: MP3 MP4 DASH HLS You can minimiz

ZExoRecyclerPlayer is an Android library that allows developers to easily create RecyclerView with Exoplayer .
ZExoRecyclerPlayer is an Android library that allows developers to easily create RecyclerView with Exoplayer .

ZExoRecyclerPlayer Description ZExoRecyclerPlayer is an Android library that allows developers to easily create RecyclerView with Exoplayer . Please f

How to play DASH type content with ExoPlayer? 📺 📱 🎞
How to play DASH type content with ExoPlayer? 📺 📱 🎞

How to use ExoPlayer ▶️ with Kotlin in Android ❓ ExoPlayer is an application level media player for Android. It provides an alternative to Android’s M

A Spotify Clone that plays music and has similar UI to actual Spotify Mobile App. Made with Exoplayer and love ❤️
A Spotify Clone that plays music and has similar UI to actual Spotify Mobile App. Made with Exoplayer and love ❤️

Spotify Clone A Spotify Clone App that can play music, and has a good looking UI that is very similar to actual Spotify Mobile App on Play Store I use

A fast dependency injector for Android and Java.

Dagger A fast dependency injector for Java and Android. Dagger is a compile-time framework for dependency injection. It uses no reflection or runtime

Owner
Jan Rabe
Native Android / Unity Developer & Technocrat #kotlin #csharp #unity #opensource
Jan Rabe
A fast, lightweight, entity component system library written in Kotlin.

Fleks A fast, lightweight, entity component system library written in Kotlin. Motivation When developing my hobby games using LibGDX, I always used As

Simon 66 Dec 28, 2022
A fast-prototyping command line system

Kotlin-er CLI A different take on making command line programs, emphasizing development speed over customization Status Auto-deployed to Maven Central

Lightning Kite 22 Jan 22, 2022
Feature flags solution that is fast, lean, and open-source.

FFS Feature flags solution that is fast, lean, and open-source. Documentation Full documentation available at https://doist.github.io/ffs/. Project FF

Doist 84 Oct 31, 2022
Koin Annotations - help declare Koin definition in a very fast and intuitive way, and generate all underlying Koin DSL for you

The goal of Koin Annotations project is to help declare Koin definition in a very fast and intuitive way, and generate all underlying Koin DSL for you. The goal is to help developer experience to scale and go fast ?? , thanks to Kotlin Compilers.

insert-koin.io 68 Jan 6, 2023
Clickstream - A Modern, Fast, and Lightweight Android Library Ingestion Platform.

Clickstream is an event agnostic, real-time data ingestion platform. Clickstream allows apps to maintain a long-running connection to send data in real-time.

Gojek 60 Dec 24, 2022
Simple, fast, efficient logging facade for Android apps

µlog Simple, fast, and efficient logging facade for Android apps. Inspired by Timber and Logcat. Features Lazy message evaluation Pluggable backends (

Danny Lin 9 Oct 21, 2022
A smart seek bar with multiple junction points at random seek position.

TerminalSeekBar A smart seek bar for android with multiple junction points at random seek position. Installation and Usage To use TerminalSeekBar in y

Owais 23 Feb 15, 2022
A player/ recorder visualizer with the swipe to seek functionality.

iiVisu A player/ recorder visualizer with the swipe to seek functionality. Demo Setup Step 1. Add the JitPack repository to your build file Add it in

Iman Irandoost 126 Nov 25, 2022
A circular seek bar for Android

CircularSeekBar A circular seek bar for Android. Modification 1. Modified setProgress(int progress) method. 2. Added hideSeekBar() To hide seekbar. 3.

Raghav Sood 289 Nov 25, 2022
Custom & highly configurable seek slider with sliding intervals, disabled state and every possible setting to tackle!

LabeledSeekSlider Custom & highly configurable seek slider with sliding intervals, disabled state and every possible setting to tackle! Minimum target

Edgar Žigis 78 Sep 27, 2022