anilbeesetti / nextlib

NextLib for Next Player
https://github.com/anilbeesetti/nextplayer
GNU General Public License v3.0
75 stars 22 forks source link
exoplayer ffmpeg ffmpeg-android media3 video-decoder

NextLib

Build nextlib

NextLib is a library for adding ffmpeg codecs to Media3.

Currently supported decoders

Setup

NextLib is available at JitPack's Maven repo.

First, you have to add the jitpack's maven repo to your build.gradle

Kotlin DSL:

repositories {
    maven { url = uri("https://jitpack.io") }
}

Groovy DSL:

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

Now, you have to add the dependency to nextlib in your build.gradle

Kotlin DSL:

dependencies {
    implementation("com.github.anilbeesetti.nextlib:nextlib-media3ext:INSERT_VERSION_HERE") // To add media3 software decoders and extensions
    implementation("com.github.anilbeesetti.nextlib:nextlib-mediainfo:INSERT_VERSION_HERE") // To get media info through ffmpeg
}

Groovy DSL:

dependencies {
    implementation "com.github.anilbeesetti.nextlib:nextlib-media3ext:INSERT_VERSION_HERE" // To add media3 software decoders and extensions
    implementation "com.github.anilbeesetti.nextlib:nextlib-mediainfo:INSERT_VERSION_HERE" // To get media info through ffmpeg
}

Usage

To use Ffmpeg decoders in your app, Add NextRenderersFactory (is one to one compatible with DefaultRenderersFactory) to ExoPlayer

val renderersFactory = NextRenderersFactory(applicationContext) 

ExoPlayer.Builder(applicationContext)
    .setRenderersFactory(renderersFactory)
    .build()