🎥 Make videos programmatically with React
remove rust implementation
Jonny Burger97ff5fd315c3
diff --git a/packages/compositor-darwin-arm64/remotion b/packages/compositor-darwin-arm64/remotionindex 774f686ecd..3eb75515ee 100755Binary files a/packages/compositor-darwin-arm64/remotion and b/packages/compositor-darwin-arm64/remotion differdiff --git a/packages/renderer/Cargo.lock b/packages/renderer/Cargo.lockindex 94b163eb62..35354289fa 100644--- a/packages/renderer/Cargo.lock+++ b/packages/renderer/Cargo.lock@@ -8,26 +8,6 @@ version = "1.0.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"-[[package]]-name = "arboard"-version = "3.2.0"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "d6041616acea41d67c4a984709ddab1587fd0b10efe5cc563fee954d2f011854"-dependencies = [- "clipboard-win",- "core-graphics",- "image",- "log",- "objc",- "objc-foundation",- "objc_id",- "once_cell",- "parking_lot",- "thiserror",- "winapi",- "x11rb",-]-[[package]]name = "autocfg"version = "1.1.0"@@ -70,12 +50,6 @@ version = "2.6.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"-[[package]]-name = "block"-version = "0.1.6"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"-[[package]]name = "bytemuck"version = "1.13.1"@@ -129,63 +103,18 @@ dependencies = ["libloading",]-[[package]]-name = "clipboard-win"-version = "4.5.0"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362"-dependencies = [- "error-code",- "str-buf",- "winapi",-]-[[package]]name = "color_quant"version = "1.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"-[[package]]-name = "core-foundation"-version = "0.9.3"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"-dependencies = [- "core-foundation-sys",- "libc",-]-[[package]]name = "core-foundation-sys"version = "0.8.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"-[[package]]-name = "core-graphics"-version = "0.22.3"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb"-dependencies = [- "bitflags 1.3.2",- "core-foundation",- "core-graphics-types",- "foreign-types",- "libc",-]--[[package]]-name = "core-graphics-types"-version = "0.1.2"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33"-dependencies = [- "bitflags 1.3.2",- "core-foundation",- "libc",-]-[[package]]name = "crc32fast"version = "1.3.2"@@ -215,7 +144,7 @@ dependencies = ["autocfg","cfg-if","crossbeam-utils",- "memoffset 0.8.0",+ "memoffset","scopeguard",]@@ -240,16 +169,6 @@ version = "1.8.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"-[[package]]-name = "error-code"-version = "2.3.1"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21"-dependencies = [- "libc",- "str-buf",-]-[[package]]name = "exr"version = "1.72.0"@@ -308,7 +227,7 @@ checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153"dependencies = ["cfg-if","libc",- "redox_syscall 0.2.16",+ "redox_syscall","windows-sys",]@@ -331,31 +250,6 @@ dependencies = ["spin",]-[[package]]-name = "foreign-types"-version = "0.3.2"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"-dependencies = [- "foreign-types-shared",-]--[[package]]-name = "foreign-types-shared"-version = "0.1.1"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"--[[package]]-name = "gethostname"-version = "0.2.3"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e"-dependencies = [- "libc",- "winapi",-]-[[package]]name = "gif"version = "0.12.0"@@ -475,36 +369,12 @@ dependencies = ["scopeguard",]-[[package]]-name = "log"-version = "0.4.20"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"--[[package]]-name = "malloc_buf"-version = "0.0.6"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"-dependencies = [- "libc",-]-[[package]]name = "memchr"version = "2.5.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"-[[package]]-name = "memoffset"-version = "0.6.5"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"-dependencies = [- "autocfg",-]-[[package]]name = "memoffset"version = "0.8.0"@@ -552,18 +422,6 @@ dependencies = ["thiserror",]-[[package]]-name = "nix"-version = "0.24.3"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069"-dependencies = [- "bitflags 1.3.2",- "cfg-if",- "libc",- "memoffset 0.6.5",-]-[[package]]name = "nom"version = "7.1.3"@@ -636,64 +494,12 @@ dependencies = ["libc",]-[[package]]-name = "objc"-version = "0.2.7"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"-dependencies = [- "malloc_buf",-]--[[package]]-name = "objc-foundation"-version = "0.1.1"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"-dependencies = [- "block",- "objc",- "objc_id",-]--[[package]]-name = "objc_id"-version = "0.1.1"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b"-dependencies = [- "objc",-]-[[package]]name = "once_cell"version = "1.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"-[[package]]-name = "parking_lot"-version = "0.12.1"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"-dependencies = [- "lock_api",- "parking_lot_core",-]--[[package]]-name = "parking_lot_core"-version = "0.9.8"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447"-dependencies = [- "cfg-if",- "libc",- "redox_syscall 0.3.5",- "smallvec",- "windows-targets 0.48.0",-]-[[package]]name = "pkg-config"version = "0.3.26"@@ -769,15 +575,6 @@ dependencies = ["bitflags 1.3.2",]-[[package]]-name = "redox_syscall"-version = "0.3.5"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"-dependencies = [- "bitflags 1.3.2",-]-[[package]]name = "regex"version = "1.7.3"@@ -797,7 +594,6 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"name = "remotion-renderer"version = "0.1.0"dependencies = [- "arboard","ffmpeg-next","image","jpeg-decoder",@@ -887,12 +683,6 @@ dependencies = ["lock_api",]-[[package]]-name = "str-buf"-version = "1.0.6"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0"-[[package]]name = "syn"version = "2.0.13"@@ -995,15 +785,6 @@ version = "0.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"-[[package]]-name = "winapi-wsapoll"-version = "0.1.1"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e"-dependencies = [- "winapi",-]-[[package]]name = "winapi-x86_64-pc-windows-gnu"version = "0.4.0"@@ -1152,28 +933,6 @@ version = "0.52.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"-[[package]]-name = "x11rb"-version = "0.10.1"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "592b4883219f345e712b3209c62654ebda0bb50887f330cbd018d0f654bfd507"-dependencies = [- "gethostname",- "nix",- "winapi",- "winapi-wsapoll",- "x11rb-protocol",-]--[[package]]-name = "x11rb-protocol"-version = "0.10.0"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "56b245751c0ac9db0e006dc812031482784e434630205a93c73cfefcaabeac67"-dependencies = [- "nix",-]-[[package]]name = "xattr"version = "0.2.3"diff --git a/packages/renderer/Cargo.toml b/packages/renderer/Cargo.tomlindex 4ca9e3d238..0a076418b3 100644--- a/packages/renderer/Cargo.toml+++ b/packages/renderer/Cargo.toml@@ -16,7 +16,6 @@ jpeg-encoder = "0.5.1"lazy_static = "1.4"rayon = "1.7.0"image = "0.24.7"-arboard = "3.2.0"sysinfo = "0.30.7"mp4 = {git = "https://github.com/jonnyburger/mp4-rust", rev = "92ba375738cc2f05a4d754e1f968cf2e97d06641"}ffmpeg-next = {git = "https://github.com/remotion-dev/rust-ffmpeg", rev ="b3878a087fc5be3985974cec9627072bc94b8f52"}diff --git a/packages/renderer/rust/commands/mod.rs b/packages/renderer/rust/commands/mod.rsindex 7bec5405dc..c7431748ca 100644--- a/packages/renderer/rust/commands/mod.rs+++ b/packages/renderer/rust/commands/mod.rs@@ -1,5 +1,4 @@use crate::compositor::draw_layer;-use crate::copy_clipboard::copy_to_clipboard;use crate::errors::ErrorWithBacktrace;use crate::image::{save_as_jpeg, save_as_png};use crate::memory::is_about_to_run_out_of_memory;@@ -102,7 +101,6 @@ pub fn execute_command(opts: CliInputCommandPayload) -> Result<Vec<u8>, ErrorWitOk("".as_bytes().to_vec())}- CliInputCommandPayload::CopyImageToClipboard(command) => copy_to_clipboard(command.src),CliInputCommandPayload::ExtractAudio(_command) => {ffmpeg::extract_audio(&_command.input_path, &_command.output_path)?;Ok(vec![])diff --git a/packages/renderer/rust/copy_clipboard/mod.rs b/packages/renderer/rust/copy_clipboard/mod.rsdeleted file mode 100644index f125c36851..0000000000--- a/packages/renderer/rust/copy_clipboard/mod.rs+++ /dev/null@@ -1,89 +0,0 @@-use std::fs::File;--use arboard::Clipboard;--use crate::errors::ErrorWithBacktrace;--struct ImageBitmap {- width: usize,- height: usize,- bytes: Vec<u8>,-}--fn from_png(src: String) -> Result<ImageBitmap, ErrorWithBacktrace> {- let file = File::open(src)?;- let decoder = png::Decoder::new(file);- let mut reader = decoder.read_info()?;-- let size = reader.output_buffer_size();- let mut buf = vec![0; size];- let info = reader.next_frame(&mut buf)?;- let bytes = buf[..info.buffer_size()].to_vec();-- Ok(ImageBitmap {- width: info.width as usize,- height: info.height as usize,- bytes,- })-}--fn from_jpeg(src: String) -> Result<ImageBitmap, ErrorWithBacktrace> {- let file = File::open(src)?;- let mut decoder = jpeg_decoder::Decoder::new(file);-- let bytes = decoder.decode()?;- let info = match decoder.info() {- Some(i) => i,- None => Err(ErrorWithBacktrace::from(std::io::Error::new(- std::io::ErrorKind::Other,- "Could not get info from jpeg",- )))?,- };- Ok(ImageBitmap {- width: info.width as usize,- height: info.height as usize,- bytes: bytes- .chunks(3)- .flat_map(|chunk| {- let mut rgba = Vec::with_capacity(4);- rgba.extend_from_slice(chunk);- rgba.push(255); // setting alpha value- rgba- })- .collect(),- })-}--pub fn copy_to_clipboard(src: String) -> Result<Vec<u8>, ErrorWithBacktrace> {- let mut clipboard = Clipboard::new().unwrap();-- let suffix = match src.split(".").last() {- Some(s) => s,- None => Err(ErrorWithBacktrace::from(std::io::Error::new(- std::io::ErrorKind::Other,- "Invalid file suffix",- )))?,- };-- let bitmap = match suffix {- "png" => from_png(src),- "jpg" => from_jpeg(src),- "jpeg" => from_jpeg(src),- _ => Err(ErrorWithBacktrace::from(std::io::Error::new(- std::io::ErrorKind::Other,- format!("File suffix {} not handled", suffix),- )))?,- }?;-- match clipboard.set_image(arboard::ImageData {- width: bitmap.width,- height: bitmap.height,- bytes: std::borrow::Cow::Borrowed(&bitmap.bytes),- }) {- Ok(_) => Ok(Vec::new()),- Err(e) => Err(ErrorWithBacktrace::from(std::io::Error::new(- std::io::ErrorKind::Other,- e.to_string(),- )))?,- }-}diff --git a/packages/renderer/rust/main.rs b/packages/renderer/rust/main.rsindex 1a08ca4e13..3eb85836a6 100644--- a/packages/renderer/rust/main.rs+++ b/packages/renderer/rust/main.rs@@ -1,6 +1,5 @@mod commands;mod compositor;-mod copy_clipboard;mod errors;mod ffmpeg;mod frame_cache;diff --git a/packages/renderer/rust/payloads.rs b/packages/renderer/rust/payloads.rsindex c68bf4379d..765ee8ef12 100644--- a/packages/renderer/rust/payloads.rs+++ b/packages/renderer/rust/payloads.rs@@ -278,7 +278,6 @@ pub mod payloads {FreeUpMemory(FreeUpMemory),Echo(EchoPayload),GetVideoMetadata(GetVideoMetadata),- CopyImageToClipboard(CopyImageToClipboard),GetSilences(GetSilences),ExtractAudio(ExtractAudio),}diff --git a/packages/renderer/src/compositor/payloads.ts b/packages/renderer/src/compositor/payloads.tsindex 6b16a955f7..6b53da4533 100644--- a/packages/renderer/src/compositor/payloads.ts+++ b/packages/renderer/src/compositor/payloads.ts@@ -241,9 +241,6 @@ export type CompositorCommand = {maximum_frame_cache_size_in_bytes: number | null;verbose: boolean;};- CopyImageToClipboard: {- src: string;- };GetOpenVideoStats: {};DeliberatePanic: {};CloseAllVideos: {};