# FFmpeg decoding: sound and software video

`app/src/main/jniLibs/*/libffmpegJNI.so` is built from these, and an ordinary app build does not rebuild it.

| Part | Source | Licence |
|---|---|---|
| FFmpeg 6.0.2 | branch `release/6.0`, commit `573f2b81ebd97da81def2ba762e81b0328547004`, unchanged | LGPL 2.1 or later |
| JNI wrapper, `jni/ffmpeg_jni.cc` | Media3 1.8.0, `libraries/decoder_ffmpeg` | Apache 2.0 |
| Java in `app/src/main/java/androidx/media3/decoder/ffmpeg` | Media3 1.8.0, `libraries/decoder_ffmpeg` | Apache 2.0 |

FFmpeg is configured with no GPL and no non-free parts, and `build_ffmpeg.sh` stops if that changes.

Media3's `ExperimentalFfmpegVideoRenderer` is an unfinished stub, so software video is written here:
`jni/video_jni.cc`, `FfmpegVideoDecoder.java` and that renderer. The renderer factory finds it by that class
name, after the device's own decoders. It is modelled on Media3's Apache-licensed AV1 module.

To rebuild, unpack FFmpeg as `<work dir>/FFmpeg-release-6.0` and run:

    build_ffmpeg.sh <work dir> <NDK r26b dir, no spaces in the path> [ABIs...]

Before distributing the app, the FFmpeg source, this folder and the build steps must be offered at a public
address, as the LGPL asks, and the licence text must be reachable from the app.
