This library enables on-the-fly Dolby Vision and HDR10+ bitstream manipulation in ExoPlayer using libdovi.
The project uses jni-rs bindings for libdovi.
Integrating only requires setting a new HdrCompatMediaSourceFactory in your ExoPlayer instance.
-
Dolby Vision Profile 7 to Profile 8 Conversion: Can convert Profile 7 FEL and MEL videos to Profile 8 (discards the Enhancement Layer in FEL).
-
Dolby Vision Stripping: Can remove the Dolby Vision layer entirely from videos while keeping the underlying HDR10 or HDR10+ layers intact.
-
HDR10+ Stripping: Can remove the HDR10+ layer from Dolby Vision videos (mainly to resolve black screen playback bug on MediaTek MT8696D devices like the firestick 4k).
implementation("com.suyashbelekar:exoplayerhdrutils:0.4.1")// Transformation rules
val transformStrategy = TransformStrategy(
doviP7Fel = DoviStrategy.CONVERT_TO_P8, // Or DoviStrategy.DISCARD to discard entire Dovi layer, or DoviStrategy.KEEP to keep it unchanged
doviP7Mel = DoviStrategy.CONVERT_TO_P8,
doviHdr10Plus = Hdr10PlusStrategy.DISCARD // Or Hdr10PlusStrategy.KEEP to keep it unchanged
)
val player = ExoPlayer.Builder(context)
.setMediaSourceFactory(HdrCompatMediaSourceFactory(context, transformStrategy))
.build().apply {
setMediaItem(MediaItem.fromUri(videoUrl))
prepare()
playWhenReady = true
}Any existing MediaSourceFactory can be passed as a delegate, if needed.
HdrCompatMediaSourceFactory(existingMediaSourceFactory, transformStrategy)- Minimum SDK: 23
- Architecture Support: arm64-v8a, armeabi-v7a, x86_64
All credit goes to quietvoid for creating and maintaining libdovi, which is the core of this project's Dolby Vision parsing and processing capabilities.
AI has been used in the development of this project, but except for some Android framework classes the rest of it (especially the core logic) has been understood by me.
This library is provided "as-is" without any warranty of any kind, either expressed or implied. By using this library, you acknowledge that I assume no liability for any bugs, app crashes, or unexpected behavior resulting from its use. (See the MIT License for full details).