letsmelon / rusvid Goto Github PK
View Code? Open in Web Editor NEWAfter Effects alternative written in Rust (no gui, under semi-active development)
License: Apache License 2.0
After Effects alternative written in Rust (no gui, under semi-active development)
License: Apache License 2.0
src/renderer/png.rs:32
: replace ::render -> anyhow::Result<()> with Ok(Default::default()) ... NOT CAUGHT in 1.861ssrc/composition/comp.rs:86
: replace ::pixels -> usize with Default::default() ... NOT CAUGHT in 1.692ssrc/renderer/ffmpeg/pixel_formats.rs:27
: replace ::build_cli_argument -> Vec with Default::default() ... NOT CAUGHT in 1.662ssrc/animation/curves/mod.rs:63
: replace ::eq -> bool with true ... NOT CAUGHT in 1.884ssrc/utils.rs:52
: replace apply_to with () ... NOT CAUGHT in 1.777ssrc/animation/curves/mod.rs:115
: replace Points::zero_2d -> Self with Default::default() ... NOT CAUGHT in 1.816ssrc/renderer/ffmpeg/pixel_formats.rs:18
: replace ::to_string -> String with "".into() ... NOT CAUGHT in 1.671ssrc/renderer/ffmpeg/codec.rs:13
: replace ::to_string -> String with "xyzzy".into() ... NOT CAUGHT in 1.697ssrc/animation/curves/mod.rs:75
: replace Points::equal_delta -> bool with true ... NOT CAUGHT in 1.779ssrc/figures/circle.rs:22
: replace ::eq -> bool with false ... NOT CAUGHT in 1.649ssrc/resolution.rs:36
: replace ::frames -> usize with Default::default() ... NOT CAUGHT in 1.649ssrc/renderer/ffmpeg/h264.rs:79
: replace ::build_cli_argument -> Vec with Default::default() ... NOT CAUGHT in 1.660ssrc/composition/comp.rs:31
: replace Composition::builder -> CompositionBuilder with Default::default() ... NOT CAUGHT in 1.681ssrc/utils.rs:25
: replace set_path with () ... NOT CAUGHT in 1.785ssrc/resolution.rs:48
: replace ::bytes -> usize with Default::default() ... NOT CAUGHT in 1.661ssrc/composition/comp.rs:82
: replace ::frames -> usize with Default::default() ... NOT CAUGHT in 1.644ssrc/figures/triangle.rs:20
: replace equilateral_triangle -> PathData with Default::default() ... NOT CAUGHT in 1.757ssrc/animation/curves/s.rs:154
: replace ::internal_debug -> std::fmt::Result with Ok(Default::default()) ... NOT CAUGHT in 1.631ssrc/renderer/ffmpeg/mod.rs:66
: replace ::render -> Result<()> with Ok(Default::default()) ... NOT CAUGHT in 1.862ssrc/animation/curves/linear.rs:75
: replace ::internal_debug -> std::fmt::Result with Ok(Default::default()) ... NOT CAUGHT in 1.744ssrc/renderer/png.rs:23
: replace ::file_extension -> String with "".into() ... NOT CAUGHT in 1.665ssrc/renderer/ffmpeg/h264.rs:45
: replace ::build_cli_argument -> Vec with Default::default() ... NOT CAUGHT in 1.679ssrc/composition/comp.rs:92
: replace ::bytes -> usize with Default::default() ... NOT CAUGHT in 1.646ssrc/animation/curves/mod.rs:129
: replace ::from -> Self with Default::default() ... NOT CAUGHT in 1.658ssrc/animation/curves/s.rs:97
: replace ::delta_raw -> Points with Default::default() ... NOT CAUGHT in 1.826ssrc/renderer/raw.rs:67
: replace ::render -> anyhow::Result<()> with Ok(Default::default()) ... NOT CAUGHT in 1.868ssrc/renderer/ffmpeg/h264.rs:65
: replace ::to_string -> String with "xyzzy".into() ... NOT CAUGHT in 1.690ssrc/renderer/ffmpeg/codec.rs:13
: replace ::to_string -> String with "".into() ... NOT CAUGHT in 1.670ssrc/animation/curves/mod.rs:123
: replace Points::two_2d -> Self with Default::default() ... NOT CAUGHT in 1.652ssrc/renderer/ffmpeg/h264.rs:27
: replace ::to_string -> String with "".into() ... NOT CAUGHT in 1.643ssrc/composition/comp.rs:65
: replace Composition::fill_with_link -> Option with Default::default() ... NOT CAUGHT in 1.670ssrc/renderer/raw.rs:52
: replace ::generate_filepath -> PathBuf with Default::default() ... NOT CAUGHT in 1.673ssrc/renderer/ffmpeg/codec.rs:28
: replace ::build_cli_argument -> Vec with Default::default() ... NOT CAUGHT in 1.818ssrc/renderer/raw.rs:58
: replace ::file_extension -> String with "xyzzy".into() ... NOT CAUGHT in 1.658ssrc/renderer/ffmpeg/h264.rs:27
: replace ::to_string -> String with "xyzzy".into() ... NOT CAUGHT in 1.633ssrc/renderer/png.rs:23
: replace ::file_extension -> String with "xyzzy".into() ... NOT CAUGHT in 1.642ssrc/renderer/raw.rs:58
: replace ::file_extension -> String with "".into() ... NOT CAUGHT in 1.665ssrc/figures/circle.rs:22
: replace ::eq -> bool with true ... NOT CAUGHT in 1.668ssrc/renderer/ffmpeg/pixel_formats.rs:18
: replace ::to_string -> String with "xyzzy".into() ... NOT CAUGHT in 1.678ssrc/renderer/ffmpeg/h264.rs:96
: replace ::build_cli_argument -> Vec with Default::default() ... NOT CAUGHT in 1.654ssrc/resolution.rs:40
: replace ::pixels -> usize with Default::default() ... NOT CAUGHT in 1.612ssrc/renderer/png.rs:17
: replace ::generate_filepath -> PathBuf with Default::default() ... NOT CAUGHT in 1.696ssrc/renderer/ffmpeg/mod.rs:60
: replace FfmpegRenderer::set_image_render with () ... NOT CAUGHT in 1.649ssrc/animation/curves/mod.rs:119
: replace Points::one_2d -> Self with Default::default() ... NOT CAUGHT in 1.726ssrc/renderer/ffmpeg/h264.rs:65
: replace ::to_string -> String with "".into() ... NOT CAUGHT in 1.639sThe program could have a big speed up if the encoder and renderer are in two seperate threads.
The encoder gets frames and encodes them into a video.
The renderer generates each frame and sends it to the encoder.
If the encoder and the renderer need the same time, then running them in parallel could half the total time to generate a video with rusvid.
Simple diagram:
sequenceDiagram
Render->>+Encoder: frame 0
Render->>+Encoder: frame 1
Render->>+Encoder: frame 2
Render->>+Encoder: frame 3
Render->>+Encoder: frame ...
Ideas:
start_frame
and end_frame
, TODO make frame a typecurve
(trait?)struct Animation {
start_frame: usize,
end_frame: usize,
curve: &'a Curve,
}
fn main() {
// 60fps, 2s
let animation = Animation {
start_frame: 60,
end_frame: 180,
curve: todo!(),
};
}
Error when compiling with 1.71.0-nightly (569b648b5 2023-05-05)
:
Compiling geo v0.24.1
error[E0275]: overflow evaluating the requirement `[closure@/Users/$user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/geo-0.24.1/src/algorithm/map_coords.rs:855:69: 855:72]: Fn<(geo_types::Coord<T>,)>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`geo`)
= note: required for `&[closure@map_coords.rs:855:69]` to implement `Fn<(geo_types::Coord<T>,)>`
= note: the full type name has been written to '/Users/$user/Documents/Programming/rusvid/target/release/deps/geo-27a27af44f7385b3.long-type-12617991455342098991.txt'
= note: 128 redundant requirements hidden
= note: required for `&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&...` to implement `Fn<(geo_types::Coord<T>,)>`
= note: the full type name has been written to '/Users/$user/Documents/Programming/rusvid/target/release/deps/geo-27a27af44f7385b3.long-type-1315908437659779592.txt'
For more information about this error, try `rustc --explain E0275`.
error: could not compile `geo` (lib) due to previous error
Quick fix because geo
already approved a fix georust/geo#1012:
Line 21 in e3cdda9
Solution:
Wait until geo
releases a new version.
Related geo
issue: georust/geo#1010
image width: w
image height: h
kernel size: k
Current implementation calculates w * h * k^2
pixels
2x 1D
implementation calculates w * h * 2* k
pixels
This change can also be used to refactor the all effect
-structs to use the same convolve effect, where possible, where the caller can also specify about edge handling (see wiki:kernel
).
Wiki: kernel, seperable_filter
let mut layer = Layer::new(Resolution::Custom(100, 100));
layer.add_to_defs(Shape::Rect(0, 0, 50, 50)).unwrap();
layer.add_filter(Filter::Bloom);
layer.add_filter(Filter::Noise);
pipeline:
┌────────────────────────────────────────────────┐
│Composition │
│ ┌──────────────────────────────┐ │
│ │Layer │ │
│ │ │ │
│ ┌─►update()───┼───►update() │ │
│ │ │ │ │ │
│ │ ▼ │ │ │
│ │ render()───┼───►render()────►effect()───┐ │ │
│ │ │ │ │ │ │
│ │ ▼ │ │ │ │
│ └──combine()◄─┼────────────────────────────┘ │ │
│ │ │ │
│ └──────────────────────────────┘ │
│ │
└────────────────────────────────────────────────┘
Implement renderer for the single image generation
.png
.bmp
Because rusvid is currently really slow at generating the images. Approximately 60% from the start to the end is spend in generating each frame as png (single core, at the time), so raw files like .bmp
should speedup the process a huge amount. But the obvious drawback is that the folder with the frames will explode in size. The rest is because of ffmpeg (without hardware acceleration).
At the time of writing (commit 3ad0cdf) in the main 30 of 300 frames have no changes.
0 - 200
animation(s)220 - 290
animationAfter a simple benchmark the rendering of all 300 frames took 89 seconds. With the skipping of re-rendering 28 frames (201 - 219
, 291 - 299
) the program could have a speedup of 10% (or 9 seconds).
Ideas
Error happend in merge, see line diff
rusvid/crates/core/src/plane.rs
Line 165 in 768ced3
I think it would be a good idea to replace the current function body with
let total_len = self.data.len() * 4;
let mut result = Vec::with_capacity(total_len);
for p in &self.data {
result.extend_from_slice(&p.to_raw());
}
result
, but before that the two versions must be bench marked.
List of used nightly features per crate of rusvid
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.