Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RicoP/raylib-video
A multithreaded pl_mpeg wrapper for Raylib
https://github.com/RicoP/raylib-video
Last synced: about 2 months ago
JSON representation
A multithreaded pl_mpeg wrapper for Raylib
- Host: GitHub
- URL: https://github.com/RicoP/raylib-video
- Owner: RicoP
- License: mit
- Created: 2023-02-25T11:03:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-02T18:26:27.000Z (11 months ago)
- Last Synced: 2024-08-03T16:08:55.509Z (5 months ago)
- Language: C
- Size: 494 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-raylib - raylib-video - video) | A multi-threaded realtime single header library to stream MPEG1 videos to textures | (List / Libraries and Frameworks)
README
# raylib-video
A multithreaded and streaming capable pl_mpeg wrapper for Raylib.
Plays MPEG1 videofiles.![preview image](example/preview.png)
# License
MIT-LicenseContains code from https://github.com/mattiasgustavsson/libs/blob/main/thread.h by Mattias Gustavsson (also MIT).
# Info
Needs pl_mpeg (https://github.com/phoboslab/pl_mpeg) to be in the include path.# How to use
Check out the header in raylibvideo.h or look into the examples folder.run
```
git submodule update --init
```Then build
## For Windows
- double click "examples/download_video_example.bat" then
- double click "examples/build.bat".## For MinGW
- run "examples/download_video_example.sh" then
- run "examples/build.sh".# API
```c
ray_video_t ray_video_open(const char * path);
ray_video_t ray_video_open_file_handle(FILE * file);
int ray_video_update(ray_video_t *, double deltatime_s);
void ray_video_destroy(ray_video_t *);
```- Check with ray_video.ok if the video was correctly loaded
- Update the video with ray_video_update
- Get the new frame over ray_video.texture
- Destroy the object at the end with ray_video_destroy# TODO
- Add seeking API
- Add interface to get the state of the current video
- Add buffering so video frames are getting pre-cached
- Add option to drop frames to stay in sync with video timing on slow rendering
- Add audio support (?)