Go to file
Martin Finkel 3ce174c733 Merge branch 'fix/audio-callback-lifecycle' into 'master'
Manage audio callback lifetime

See merge request videolan/vlc-rs!27
2026-09-01 13:18:52 +00:00
.cargo xtask: commit the lock file 2026-08-19 14:43:27 +02:00
examples Add examples 2015-11-29 17:40:58 +09:00
libvlc-sys libvlc-sys: drop the generated layout assertions 2026-09-01 10:34:21 +02:00
src Merge branch 'fix/audio-callback-lifecycle' into 'master' 2026-09-01 13:18:52 +00:00
xtask libvlc-sys: drop the generated layout assertions 2026-09-01 10:34:21 +02:00
.gitattributes misc: auto collapse generated bindings on gitlab 2026-08-27 11:44:17 +02:00
.gitignore build: commit the lock file 2026-08-19 14:45:49 +02:00
.gitlab-ci.yml ci: run the build with --locked 2026-08-19 15:10:13 +02:00
Cargo.lock libvlc-sys: import libvlc via raw-dylib on Windows 2026-08-27 11:44:17 +02:00
Cargo.toml build: replace the use-bindgen feature with a `cargo xtask bindgen` tool 2026-07-24 10:05:32 +02:00
LICENSE Initial commit 2015-11-29 10:26:04 +09:00
README.md misc: update README Windows build instructions 2026-09-01 10:34:21 +02:00

README.md

vlc-rs Build Status

Rust bindings for libVLC media framework.

Status

Many missing functions and wrappers.

Use

Please add the following dependencies to your Cargo.toml.

[dependencies]
vlc-rs = "0.3"

Or:

[dependencies.vlc-rs]
git = "https://github.com/garkimasera/vlc-rs.git"

Example

Play for 10 seconds from a media file.

extern crate vlc;
use vlc::{Instance, Media, MediaPlayer};
use std::thread;

fn main() {
    // Create an instance
    let instance = Instance::new().unwrap();
    // Create a media from a file
    let md = Media::new_path(&instance, "path_to_a_media_file.ogg").unwrap();
    // Create a media player
    let mdp = MediaPlayer::new(&instance).unwrap();
    mdp.set_media(&md);

    // Start playing
    mdp.play().unwrap();

    // Wait for 10 seconds
    thread::sleep(::std::time::Duration::from_secs(10));
}

Other examples are in the examples directory.

Building

Windows

vlc-rs uses libvlc's SDK and it is a required dependency that must be available at runtime. For that, you must either build VLC from source or grab one of the pre-built packages from videolan.org.

Once you've downloaded your chosen package, you should extract it some place such that its path contains no spaces, and add that directory to your PATH so libvlc.dll is found at startup. For distribution of an executable program, you should probably copy over the necessary DLLs, as well as the plugins directory.

License

MIT (Examples are licensed under CC0)