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!
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 |
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
;
Alternatives
- bevy_image_export: Less opinionated, no encoders included, only image sequences. This might be a better fit, if you end up using ffmpeg on the frames anyway.
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.