https://github.com/trikko/raylib-ffmpeg-video
Hacky way to display video with raylib, in C or D programming language
https://github.com/trikko/raylib-ffmpeg-video
c d dlang ffmpeg raylib video
Last synced: about 2 months ago
JSON representation
Hacky way to display video with raylib, in C or D programming language
- Host: GitHub
- URL: https://github.com/trikko/raylib-ffmpeg-video
- Owner: trikko
- Created: 2024-12-14T10:48:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-14T21:08:53.000Z (over 1 year ago)
- Last Synced: 2025-04-08T20:48:52.336Z (about 1 year ago)
- Topics: c, d, dlang, ffmpeg, raylib, video
- Language: C
- Homepage:
- Size: 2.75 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Raylib with FFmpeg - Audio/Video Rendering Example

A simple example showcasing how to use FFmpeg (the executable) with Raylib to render audio and video content.
If you find this example useful, consider buying me a beer! 🍺
https://paypal.me/andreafontana/5
## Build
To compile the project:
- C version: simply run `make` in the project directory
- D version: run `dub --single main.d` in the project directory
## Description
This project demonstrates how to integrate FFmpeg (via command line) with Raylib to:
- Play video content
- Handle synchronized audio
- Manipulate display in real-time
Since it leverages FFmpeg's extensive codec support, this solution can play almost any video format, even rare or exotic ones that FFmpeg can read.
In this example the video is streamed from Wikipedia, but FFmpeg can read content from any supported source (local files, HTTP, RTSP, UDP, etc.).
## Controls
- **Mouse**: Drag video around the window
- **Mouse Wheel**: Zoom in/out video content
## Requirements
- FFmpeg installed and available in system PATH
- Raylib
## Note
This example uses FFmpeg as an external executable and not the native libraries (libavcodec, libavformat, etc.). This approach greatly simplifies the implementation while maintaining good performance for basic use cases.