egui-video

Crates.ioegui-video
lib.rsegui-video
version0.6.0
sourcesrc
created_at2023-08-28 03:24:42.200669
updated_at2023-10-27 07:55:40.961573
descriptiona video library for egui
homepage
repositoryhttps://github.com/n00kii/egui-video
max_upload_size
id956562
size165,825
nookii (n00kii)

documentation

README

egui-video, a video playing library for egui

crates.io docs license

https://github.com/n00kii/egui-video/assets/57325298/c618ff0a-9ad2-4cf0-b14a-dda65dc54b23

plays videos in egui from file path or from bytes

dependancies:

  • requires ffmpeg 6. follow the build instructions here
  • requires sdl2. by default, a feature is enabled to automatically compile it for you, but you are free to disable it and follow these instructions

usage:

/* called once (top level initialization) */

{ // if using audio...
    let audio_device = egui_video::AudioDevice::new()?;
    
    // don't let audio_device drop out of memory! (or else you lose audio)

    add_audio_device_to_state_somewhere(audio_device);
}
/* called once (creating a player) */

let mut player = egui_video::Player::new(ctx, my_media_path)?;

{ // if using audio...
    player = player.with_audio(&mut my_state.audio_device)
}
/* called every frame (showing the player) */
player.ui(ui, player.size);

contributions

are welcome :)

current caveats

  • need to compile in release or opt-level=3 otherwise limited playback performance
Commit count: 76

cargo fmt