slint/examples/ffmpeg
David Faure 29e289fbdf Move the workspace to rust edition 2024
Motivation: the git pre-commit hook is confused by the mix of 2021 and
2024 in the same workspace...

The only problem this raises is the std::env::set_var("LANGUAGE", lang) in
demos/printerdemo/rust/lib.rs, pre-existing but now explicitly marked as unsafe
because it actually is. Added a TODO there.
2025-12-09 12:11:04 +01:00
..
player Update ffmpeg dependency to version 7.1.0 (#6460) 2024-10-07 14:54:34 +02:00
build.rs Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Cargo.toml Move the workspace to rust edition 2024 2025-12-09 12:11:04 +01:00
lib.rs ffmpeg example: Add support for Android 2025-08-28 16:44:02 +02:00
main.rs ffmpeg example: Add support for Android 2025-08-28 16:44:02 +02:00
pause.svg Fix reuse compliance check 2024-01-18 15:11:43 +01:00
play.svg Fix reuse compliance check 2024-01-18 15:11:43 +01:00
player.rs Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
README.md Remove license header from .md/.mdx files 2025-12-04 21:58:09 +01:00
scene.slint FFmpeg example: rework play/pause button 2025-07-30 08:57:58 +02:00

FFmpeg Example

This example application demonstrates the use of ffmpeg with Rust to play back video.

Building

On Linux, you need to install ffmpeg and alsa. For example on Debian based systems:

sudo apt-get install clang libavcodec-dev libavformat-dev libavutil-dev libavfilter-dev libavdevice-dev libasound2-dev pkg-config

On macOS, you can use brew:

brew install pkg-config ffmpeg

On Windows:

  • install vcpkg
  • vcpkg install ffmpeg --triplet x64-windows
  • SetVCPKG_ROOT to where vcpkg is installed
  • Add %VCPKG_ROOT%\installed\x64-windows\bin to your path
  • Run vcpkg install llvm[clang,target-x86]:x64-windows
  • Set LIBCLANG_PATH to where clang is installed: %VCPKG_ROOT%\installed\x64-windows\bin

Screenshot of the FFmpeg Example on macOS

For Android: