6 releases (breaking)

0.9.0 Oct 28, 2024
0.8.0 Sep 30, 2024
0.7.0 Aug 17, 2024
0.6.0 Oct 27, 2023
0.5.2 Aug 28, 2023

#78 in Video

Download history 12/week @ 2024-07-24 10/week @ 2024-07-31 123/week @ 2024-08-14 9/week @ 2024-08-21 1/week @ 2024-08-28 1/week @ 2024-09-04 9/week @ 2024-09-11 8/week @ 2024-09-18 167/week @ 2024-09-25 36/week @ 2024-10-02 16/week @ 2024-10-09 5/week @ 2024-10-16 135/week @ 2024-10-23 44/week @ 2024-10-30 14/week @ 2024-11-06

199 downloads per month

MIT license

79KB
1.5K SLoC

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 or 7. 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

Dependencies

~23–35MB
~629K SLoC