video_normalizer_android 0.1.2
video_normalizer_android: ^0.1.2 copied to clipboard
Android implementation of the video_normalizer plugin, built on Jetpack Media3 Transformer. No bundled FFmpeg and no native libraries.
video_normalizer_android #
The Android implementation of video_normalizer. Apps
depend on video_normalizer; this package is endorsed and comes with it.
What it is made of #
| Engine | Jetpack Media3 Transformer 1.11.1 (media3-transformer, media3-effect, media3-common) |
| Language and build | Kotlin, Gradle Kotlin DSL, Java 17 source and target level |
minSdk / compileSdk |
24 / 36 |
| Native libraries | none |
| Permissions | none |
| Channel | generated by Pigeon from the platform interface's pigeons/messages.dart; no hand-written channel code |
The Gradle script works with AGP 9's built-in Kotlin and with the Kotlin Gradle
Plugin, never applies Kotlin twice and never names a Kotlin version. See
docs/ANDROID_BUILD.md for the consumer
configurations that were built.
How a job runs #
JobRegistry is process-wide, so jobs outlive the Flutter engine that started
them and several engines can share it. One HandlerThread runs every job's
state machine and is the looper Media3 is bound to.
MediaAnalyzerreads the source withMediaExtractorand a small MP4 box scanner: nothing is decoded.EncoderSettingsVerifierconfirms the resolved settings against the device's encoders (MediaCodecList) before anything is decoded. The encoder it picked is the encoder Media3 is given.TransformerEnginebuilds the Media3 export: scaling, frame-rate reduction, HDR tone mapping, audio mix-down, metadata filtering. Encoder and format fallbacks are switched off.FastStartRelocatormoves the MP4 index to the front of the file, in place.OutputValidatorreopens the file and compares it with what was asked for. Only then does the file get its final name.
A failure at any step deletes the partial file and reaches Dart as one of the
codes in docs/ERRORS.md.
Status #
Integration tested on emulators (API 34; the release build also on API 35 with
16 KB pages). Not tested on physical devices. HDR tone mapping could not be run
on an emulator at all. Details: docs/COMPATIBILITY.md.
Working on it #
# unit tests (JVM)
cd packages/video_normalizer/example/android
gradlew :video_normalizer_android:testDebugUnitTest
# lint
cd packages/video_normalizer_android/android
java -jar ktlint-cli-1.8.0-all.jar "src/**/*.kt" "*.kts"
# everything on a device
tool\run_android_integration.ps1