-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Easy screenrecording plugin #21237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Easy screenrecording plugin #21237
Conversation
b901e65 to
746e1fc
Compare
72d67c1 to
5e206e0
Compare
5e206e0 to
88f3173
Compare
|
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. |
|
Also, why not https://crates.io/crates/video-rs? |
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". |
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 |
|
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note. Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes. |
|
now with a fixed frame time:
|
|
More of a note for the future that may or may not be worth it but it would be nice to have a way to conveniently playback what was just recorded. |
I still disagree with this, the video crate lets you // One time init...
video_rs::init().unwrap();
let settings = Settings::preset_h264_yuv420p(1920, 1080, false);
let mut encoder = Encoder::new("foo.mp4", settings)?;
let frame_duration = Time::from_nth_of_a_second(30);
let mut position = Time::zero();
// For all screenshots
let to_encode = Frame::from_shape_vec([1080, 1920, 3], screenshot.to_rgb8()).unwrap();
encoder.encode(to_encode, position);
position = position.aligned_with(frame_duration).add();Then the finished |
|
Adding my two cents (tldr): Using If the application is crashing, then the entire |
|
Also please note: x264 is GPL-licensed, but the H.264/AVC codec itself is covered by MPEG-LA patents. This means even open-source projects might need to pay license fees when distributing software that includes H.264 encoding. So using x264 can have legal and licensing risks. I would rather use VP8/VP9 or (even better but there are no good software decoder and less hardware decoder) AV1. Edit: I would recommend the vpx-rs crate, this is much better, it supports vp8/vp9 and there are no patent/license problems. :) |
kerkmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move from x264 to vp8/vp9 or av1 regards MPEG/LA patents.
pablo-lua
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have an example on how to use this feature?
Objective
Solution
EasyScreenRecordPluginin the dev toolsTesting
bevy_internal/screenrecordingenabledffmpegis our friend!for file in *.h264; do ffmpeg -i $file $file.mp4; doneShowcase
directly taken by Bevy
load_gltf-1758937494581.h264.mp4