#libmpv #playback #mpv #media-playback

libmpv2

Libmpv abstraction that's easy to use and can play next to all codecs and containers

7 stable releases

Uses new Rust 2024

5.0.3 Dec 29, 2025
5.0.2 Dec 18, 2025
5.0.1 Aug 10, 2025
5.0.0 Jul 27, 2025
3.0.0 Apr 12, 2024

#185 in Audio

Download history 283/week @ 2025-10-15 251/week @ 2025-10-22 197/week @ 2025-10-29 171/week @ 2025-11-05 297/week @ 2025-11-12 327/week @ 2025-11-19 202/week @ 2025-11-26 186/week @ 2025-12-03 167/week @ 2025-12-10 156/week @ 2025-12-17 180/week @ 2025-12-24 118/week @ 2025-12-31 289/week @ 2026-01-07 351/week @ 2026-01-14 376/week @ 2026-01-21 441/week @ 2026-01-28

1,479 downloads per month
Used in hls_client

LGPL-2.1

11MB
2.5K SLoC

Credits go to @anlumo for the rendering implementation and @sirno for updating the API to support libmpv version 2.0.

libmpv2-rs

A libmpv abstraction written in rust that's easy to use and provides the ability to read next to all video and audio codecs.

Dependencies

Rust version >= 1.30. Libmpv version 2.0 (mpv version 0.35.0) is the minimum required version.

For ease of building, you can use the build_libmpv feature that is used to link against. Especially useful to cross compile to windows. The MPV_SOURCE environment variable needs to be set to a directory containing the mpv source you want to build against. For windows targets this is expected to be already built, with a directory named MPV_SOURCE/64 or /32 containing build artifacts for 64-bit and 32-bit targets respectively. On unix this is expected to be a copy of the mpv-build repo.

Examples

To run an example, execute cargo run [--release] --example x -- test-data/jellyfish.mp4, where x is any of:

  • events: event enumeration
  • protocol: implementation of custom filereader:// protocol that… reads files
  • opengl: openGL rendering onto SDL2 window

Contributing

All pull requests/issues welcome.

Dependencies