Skip to content

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented Sep 27, 2025

Objective

Solution

  • Make a new EasyScreenRecordPlugin in the dev tools

Testing

  • Add to any example
        .add_plugins(bevy::dev_tools::EasyScreenRecordPlugin::default())
  • Run the example with the feature bevy_internal/screenrecording enabled
  • press the space bar
  • wait for it...
  • press the space bar again
  • screen recording! 🎉
  • almost... you now have a h264 file. VLC can read them, but they are not the most friendly format
  • ffmpeg is our friend! for file in *.h264; do ffmpeg -i $file $file.mp4; done
  • you now have a .mp4 file that can be shared anywhere!

Showcase

directly taken by Bevy

load_gltf-1758937494581.h264.mp4

@mockersf mockersf force-pushed the easy-screenrecording branch from b901e65 to 746e1fc Compare September 27, 2025 01:55
@mockersf mockersf force-pushed the easy-screenrecording branch from 72d67c1 to 5e206e0 Compare September 27, 2025 10:16
@mockersf mockersf force-pushed the easy-screenrecording branch from 5e206e0 to 88f3173 Compare September 27, 2025 10:18
@mockersf mockersf mentioned this pull request Sep 27, 2025
@torsteingrindvik
Copy link
Contributor

Would be even better imo if I could choose which resolution to record at.

One way could be to have the plugin take care to copy the source texture to another texture then rescale as part of the render graph.

Another could be to just use the CPU data and resize via e.g. the image crate or similar.

The user-responsibility way is probably to have them choose the correct primary window size, but if I have a low res screen and want to record e.g. 4k then it's better to have an off-screen render target.

@torsteingrindvik
Copy link
Contributor

Also, why not https://crates.io/crates/video-rs?

@mockersf
Copy link
Member Author

Would be even better imo if ...

I agree, but I think out of scope of this PR, that's part of the frame capture pipeline, this PR is mostly on what to do with the frames once captured. And hopefully to stay "easy and simple".

@mockersf
Copy link
Member Author

mockersf commented Sep 27, 2025

Also, why not https://crates.io/crates/video-rs?

Mainly because I'm so used to use ffmeg on the command line that I didn't look for a crate for it but directly for an encoder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants