bevy_capture
A Bevy plugin for capturing frames from a Bevy application. It comes with some built-in encoders, e.g. for creating gifs or videos, and can be easily extended with custom encoders.
Current Limitations
- Only headless rendering is supported, but windowed rendering should be possible as well. PRs are welcome!
- There isn't a built-in method to determine when everything is ready (such as assets loaded and pipelines built). The best approach is to wait a few frames before starting the capture.
Built-in Encoders
| Name | Description | Required Features |
|---|---|---|
FramesEncoder |
Encodes frames into individual images. | |
GifEncoder |
Encodes frames into a gif. | gif |
Mp4Openh264Encoder*⚠️ |
Encodes frames into an mp4 using openh264. | mp4_openh264 |
Mp4FfmpegCliEncoder |
Encodes frames into an mp4 using the ffmpeg CLI (ffmpeg must be in PATH). | mp4_ffmpeg_cli |
*⚠️ The Mp4Openh264Encoder is incomplete and does not work properly yet. PRs are welcome!
Usage
For a complete example, see the simple example.
// Add plugins
app.add_plugins;
// Spawn a camera with the CaptureBundle
// Start capturing
Implementing a Custom Encoder
;
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE-2.0 or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.