trikko/raylib-libvlc-example
trikko/raylib-libvlc-example has 71 GitHub stars and 5 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-18 08:09 UTC. Last push 2026-10-05.
What you can do
- Many videos at once, each one draggable, with play/pause, restart and seek
- Drag & drop files on the window, or pass them on the command line
- Streams and webcams too (see the comment in main.c)
- Single C file, no engine or framework
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Play videos in raylib with libvlc: render any format, network stream or webcam to a texture. Minimal C example, plus a D version, for Linux, macOS and Windows.
Creative & MediaREADME.md
Originalraylib + libvlc: play videos in raylib
A minimal C example that plays videos inside a raylib window using libvlc: every format VLC can open (mp4, mkv, webm, avi, ...), network streams and webcams, rendered to a raylib texture. Works on Linux, macOS and Windows.
I bet you have been trying to render and control a video with raylib for a long long time. Don't you think you should at least buy me a beer?

Features
- Many videos at once, each one draggable, with play/pause, restart and seek
- Drag & drop files on the window, or pass them on the command line
- Streams and webcams too (see the comment in
main.c) - Single C file, no engine or framework
How it works
libvlc decodes the video on its own threads and writes each frame, already scaled, into a memory buffer
through libvlc_video_set_callbacks(). Frames are triple buffered: the main thread picks the latest one
and uploads it with UpdateTexture(), holding the lock only to swap pointers.
How to build
- Install raylib 4.2 or newer. Build instructions here.
- Install libvlc 3.x and glib. On debian/ubuntu/etc.:
sudo apt-get install libvlc-dev libglib2.0-dev - Run
make
macOS
With Homebrew. libvlc comes with VLC.app:
brew install pkg-config raylib glib
brew install --cask vlc
make
If VLC.app is not in /Applications, use make VLC_DIR=/path/to/VLC.app/Contents/MacOS.
libvlc must be told where VLC.app keeps its plugins:
export VLC_PLUGIN_PATH=/Applications/VLC.app/Contents/MacOS/plugins
Windows
Use MSYS2. From the UCRT64 shell:
pacman -S make mingw-w64-ucrt-x86_64-{gcc,pkgconf,raylib,glib2,vlc}
make
How to use
- Drop one or more videos on the window, or pass them on the command line.
- Drag a video to move it, click on its bar to seek.
SPACEplay/pause,Rrestart,Cclose the video on top.
D version
The same example written in D is in d/. It uses the C headers directly
through ImportC, with no bindings to write or install.
cd d
dub build
./raylib-libvlc-example
Screenshots from CI
Taken by the automated build tests: on every push the build workflow builds the example on each OS, plays two test videos and captures the screen.
| Linux | macOS | Windows |
|---|---|---|
![]() |
![]() |
![]() |
The test videos are clips from Big Buck Bunny, (c) Blender Foundation, CC BY 3.0.
See also
- raylib-ffmpeg-video: the same with ffmpeg


