slint/examples/gstreamer-player
2025-09-11 14:01:14 +00:00
..
slint_video_sink GStreamer example: remove anyhow 2025-07-30 10:06:08 +02:00
build.rs gstreamer-player: Make the EGL integration easier to re-use 2025-01-17 14:14:02 +01:00
Cargo.toml Bump version number to 1.14.0 2025-09-11 14:01:14 +00:00
main.rs GStreamer example: add clarifying comment 2025-07-30 10:06:08 +02:00
pause.svg Rename gstreamer_player to streamer-player 2024-02-07 11:22:48 +01:00
play.svg Rename gstreamer_player to streamer-player 2024-02-07 11:22:48 +01:00
README.md GStreamer example: clarify README.md 2025-07-30 10:06:08 +02:00
scene.slint GStreamer example: set window to dimensions of example video 2025-07-29 20:33:39 +02:00

GStreamer Example

This example application demonstrates a way to use GStreamer (with Rust bindings) to display a video stream in Slint and communicate state changes between Slint and GStreamer. On Linux, this can take advantage of hardware accelerated rendering and transfer the video to Slint via EGL. On other platforms, the video gets transferred via CPU accessible buffers.

Current Status:

  • The code has so far only been tested on Ubuntu and Windows.

Building and Running

You will need to have the gstreamer libraries used by gstreamer-rs installed.

https://gstreamer.pages.freedesktop.org/gstreamer-rs/stable/latest/docs/gstreamer/

On Debian/Ubuntu you can use:

$ apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
      gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
      gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
      gstreamer1.0-libav libgstrtspserver-1.0-dev libges-1.0-dev

On Opensuse you can use:

$ zypper in zypper in gstreamer-plugins-bad-devel gstreamer-devel gstreamer-plugins-base-devel \
      gstreamer-plugins-good

On windows:

  • Install gstreamer using official binaries (we need to install both, e.g. gstreamer-1.0-msvc-x86_64-1.24.11.msi and gstreamer-1.0-devel-msvc-x86_64-1.24.11.msi), make sure to install full gstreamer in installer.
  • And export it to path:
# For a UNIX-style shell:
$ export PATH="c:/gstreamer/1.0/msvc_x86_64/bin${PATH:+:$PATH}"

# For cmd.exe:
$ set PATH=C:\gstreamer\1.0\msvc_x86_64\bin;%PATH%

Once you have a working gstreamer-rs and slint install, cargo run should work.