Libvlcjni.so |verified|: Kmp External Codec

libvlcjni.so loads decoders like libavcodec.so internally – external codecs work immediately. 3.3 iOS / Darwin Target iOS uses MobileVLCKit (Objective-C framework) which also bundles FFmpeg. A Kotlin/Native interop can be created, or use cinterop to call VLCKit, achieving identical external codec support. 4. Verifying External Codec Activation To confirm that libvlcjni.so is using its own decoders and not Android’s MediaCodec:

libvlc: using decoder module "avcodec" avcodec: using FFmpeg decoder for codec 'eac3' | Aspect | libvlcjni.so (Software) | MediaCodec (Hardware) | |--------|------------------------|------------------------| | CPU usage | High for 4K/HEVC | Low (GPU/DSP) | | Codec support | Full (hundreds) | Limited by device | | External codecs | Yes (built-in) | Rarely | | KMP compatibility | Works on Android, Linux, Windows | Android-only | kmp external codec libvlcjni.so

// androidMain/kotlin/PlatformMediaPlayer.kt import org.videolan.libvlc.LibVLC import org.videolan.libvlc.MediaPlayer import org.videolan.libvlc.Media actual class PlatformMediaPlayer private lateinit var libVLC: LibVLC private lateinit var mediaPlayer: MediaPlayer libvlcjni

Enable verbose logging:

val args = arrayOf("-vvv", "--codec=avcodec") // force ffmpeg decoders libVLC = LibVLC(context, args) Look for logcat output: decoupled from the OS. On Android

The engine, via libvlcjni.so – its Android JNI bridge – provides a solution by bundling ffmpeg with hundreds of built-in external codecs, decoupled from the OS.

On Android, the libvlcjni.so ‑backed player will output audio correctly, whereas ExoPlayer would fail with No decoder for: audio/ac3 . libvlcjni.so provides KMP developers with a powerful, unified way to handle external codecs that are absent from platform decoders. By wrapping VLC’s engine in a KMP expect/actual pattern, you can achieve cross-platform playback with near‑identical behavior and extensive format support.

Sender auswählen

Jetzt in der Senderleiste auf klicken.

Gelesen
Seite merken

Lesezeichen für tvheute.at erstellen:
Jetzt in der Symbolleiste auf klicken.

Gelesen
Sender navigieren
links | rechts
WISCHEN