Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
editor export button
Brendan Allan044867093712
diff --git a/Cargo.lock b/Cargo.lockindex 59116b7fc..b055b21d2 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -305,6 +305,132 @@ dependencies = ["libloading 0.8.5",]+[[package]]+name = "ashpd"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dd884d7c72877a94102c3715f3b1cd09ff4fac28221add3e57cfbe25c236d093"+dependencies = [+ "enumflags2",+ "futures-channel",+ "futures-util",+ "rand 0.8.5",+ "serde",+ "serde_repr",+ "tokio",+ "url",+ "zbus",+]++[[package]]+name = "async-broadcast"+version = "0.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e"+dependencies = [+ "event-listener",+ "event-listener-strategy",+ "futures-core",+ "pin-project-lite",+]++[[package]]+name = "async-channel"+version = "2.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a"+dependencies = [+ "concurrent-queue",+ "event-listener-strategy",+ "futures-core",+ "pin-project-lite",+]++[[package]]+name = "async-io"+version = "2.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8"+dependencies = [+ "async-lock",+ "cfg-if 1.0.0",+ "concurrent-queue",+ "futures-io",+ "futures-lite",+ "parking",+ "polling",+ "rustix",+ "slab",+ "tracing",+ "windows-sys 0.59.0",+]++[[package]]+name = "async-lock"+version = "3.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18"+dependencies = [+ "event-listener",+ "event-listener-strategy",+ "pin-project-lite",+]++[[package]]+name = "async-process"+version = "2.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a8a07789659a4d385b79b18b9127fc27e1a59e1e89117c78c5ea3b806f016374"+dependencies = [+ "async-channel",+ "async-io",+ "async-lock",+ "async-signal",+ "async-task",+ "blocking",+ "cfg-if 1.0.0",+ "event-listener",+ "futures-lite",+ "rustix",+ "tracing",+ "windows-sys 0.59.0",+]++[[package]]+name = "async-recursion"+version = "1.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.75",+]++[[package]]+name = "async-signal"+version = "0.2.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3"+dependencies = [+ "async-io",+ "async-lock",+ "atomic-waker",+ "cfg-if 1.0.0",+ "futures-core",+ "futures-io",+ "rustix",+ "signal-hook-registry",+ "slab",+ "windows-sys 0.59.0",+]++[[package]]+name = "async-task"+version = "4.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"+[[package]]name = "async-trait"version = "0.1.81"@@ -568,6 +694,19 @@ dependencies = ["objc2 0.5.2",]+[[package]]+name = "blocking"+version = "1.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea"+dependencies = [+ "async-channel",+ "async-task",+ "futures-io",+ "futures-lite",+ "piper",+]+[[package]]name = "brotli"version = "3.5.0"@@ -1516,6 +1655,17 @@ dependencies = ["serde",]+[[package]]+name = "derivative"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 1.0.109",+]+[[package]]name = "derive_more"version = "0.99.18"@@ -1563,6 +1713,7 @@ dependencies = ["tauri-build","tauri-nspanel","tauri-plugin-decorum",+ "tauri-plugin-dialog","tauri-plugin-fs","tauri-plugin-shell","tauri-specta",@@ -1744,6 +1895,12 @@ dependencies = ["cfg-if 1.0.0",]+[[package]]+name = "endi"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf"+[[package]]name = "enigo"version = "0.1.3"@@ -1757,6 +1914,27 @@ dependencies = ["windows 0.51.1",]+[[package]]+name = "enumflags2"+version = "0.7.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d"+dependencies = [+ "enumflags2_derive",+ "serde",+]++[[package]]+name = "enumflags2_derive"+version = "0.7.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.75",+]+[[package]]name = "equivalent"version = "1.0.1"@@ -1783,6 +1961,27 @@ dependencies = ["windows-sys 0.52.0",]+[[package]]+name = "event-listener"+version = "5.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba"+dependencies = [+ "concurrent-queue",+ "parking",+ "pin-project-lite",+]++[[package]]+name = "event-listener-strategy"+version = "0.5.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1"+dependencies = [+ "event-listener",+ "pin-project-lite",+]+[[package]]name = "exr"version = "1.72.0"@@ -2045,6 +2244,19 @@ version = "0.3.30"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"+[[package]]+name = "futures-lite"+version = "2.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"+dependencies = [+ "fastrand",+ "futures-core",+ "futures-io",+ "parking",+ "pin-project-lite",+]+[[package]]name = "futures-macro"version = "0.3.30"@@ -3732,6 +3944,7 @@ dependencies = ["bitflags 2.6.0","cfg-if 1.0.0","libc",+ "memoffset 0.9.1",][[package]]@@ -4209,6 +4422,16 @@ dependencies = ["libredox 0.0.2",]+[[package]]+name = "ordered-stream"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"+dependencies = [+ "futures-core",+ "pin-project-lite",+]+[[package]]name = "os_info"version = "3.8.2"@@ -4270,6 +4493,12 @@ dependencies = ["system-deps",]+[[package]]+name = "parking"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"+[[package]]name = "parking_lot"version = "0.12.3"@@ -4477,6 +4706,17 @@ version = "0.1.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"+[[package]]+name = "piper"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"+dependencies = [+ "atomic-waker",+ "fastrand",+ "futures-io",+]+[[package]]name = "pipewire"version = "0.8.0"@@ -5050,6 +5290,30 @@ dependencies = ["windows-registry",]+[[package]]+name = "rfd"+version = "0.14.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "25a73a7337fc24366edfca76ec521f51877b114e42dab584008209cca6719251"+dependencies = [+ "ashpd",+ "block",+ "dispatch",+ "glib-sys",+ "gobject-sys",+ "gtk-sys",+ "js-sys",+ "log",+ "objc",+ "objc-foundation",+ "objc_id",+ "raw-window-handle 0.6.2",+ "wasm-bindgen",+ "wasm-bindgen-futures",+ "web-sys",+ "windows-sys 0.48.0",+]+[[package]]name = "rgb"version = "0.8.48"@@ -6263,6 +6527,24 @@ dependencies = ["tauri-plugin",]+[[package]]+name = "tauri-plugin-dialog"+version = "2.0.0-rc.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6c538457a755a75b8bb1594ed40d1512f8f6386251d3fcde492f8f46768ec85b"+dependencies = [+ "dunce",+ "log",+ "raw-window-handle 0.6.2",+ "rfd",+ "serde",+ "serde_json",+ "tauri",+ "tauri-plugin",+ "tauri-plugin-fs",+ "thiserror",+]+[[package]]name = "tauri-plugin-fs"version = "2.0.0-rc.0"@@ -6632,6 +6914,7 @@ dependencies = ["signal-hook-registry","socket2","tokio-macros",+ "tracing","windows-sys 0.52.0",]@@ -6939,6 +7222,17 @@ version = "1.17.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"+[[package]]+name = "uds_windows"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9"+dependencies = [+ "memoffset 0.9.1",+ "tempfile",+ "winapi",+]+[[package]]name = "uname"version = "0.1.1"@@ -8269,6 +8563,16 @@ version = "0.3.8"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0ef33da6b1660b4ddbfb3aef0ade110c8b8a781a3b6382fa5f2b5b040fd55f61"+[[package]]+name = "xdg-home"+version = "1.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6"+dependencies = [+ "libc",+ "windows-sys 0.59.0",+]+[[package]]name = "xkbcommon-dl"version = "0.4.2"@@ -8303,6 +8607,65 @@ dependencies = ["winapi",]+[[package]]+name = "zbus"+version = "4.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7b8e3d6ae3342792a6cc2340e4394334c7402f3d793b390d2c5494a4032b3030"+dependencies = [+ "async-broadcast",+ "async-process",+ "async-recursion",+ "async-trait",+ "derivative",+ "enumflags2",+ "event-listener",+ "futures-core",+ "futures-sink",+ "futures-util",+ "hex",+ "nix 0.27.1",+ "ordered-stream",+ "rand 0.8.5",+ "serde",+ "serde_repr",+ "sha1",+ "static_assertions",+ "tokio",+ "tracing",+ "uds_windows",+ "windows-sys 0.52.0",+ "xdg-home",+ "zbus_macros",+ "zbus_names",+ "zvariant",+]++[[package]]+name = "zbus_macros"+version = "4.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b7a3e850ff1e7217a3b7a07eba90d37fe9bb9e89a310f718afcde5885ca9b6d7"+dependencies = [+ "proc-macro-crate 1.3.1",+ "proc-macro2",+ "quote",+ "regex",+ "syn 1.0.109",+ "zvariant_utils",+]++[[package]]+name = "zbus_names"+version = "3.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c"+dependencies = [+ "serde",+ "static_assertions",+ "zvariant",+]+[[package]]name = "zerocopy"version = "0.7.35"@@ -8347,3 +8710,41 @@ checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768"dependencies = ["zune-core",]++[[package]]+name = "zvariant"+version = "4.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4e09e8be97d44eeab994d752f341e67b3b0d80512a8b315a0671d47232ef1b65"+dependencies = [+ "endi",+ "enumflags2",+ "serde",+ "static_assertions",+ "url",+ "zvariant_derive",+]++[[package]]+name = "zvariant_derive"+version = "4.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "72a5857e2856435331636a9fbb415b09243df4521a267c5bedcd5289b4d5799e"+dependencies = [+ "proc-macro-crate 1.3.1",+ "proc-macro2",+ "quote",+ "syn 1.0.109",+ "zvariant_utils",+]++[[package]]+name = "zvariant_utils"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 1.0.109",+]diff --git a/apps/desktop-solid/package.json b/apps/desktop-solid/package.jsonindex b9612c966..542e773e8 100644--- a/apps/desktop-solid/package.json+++ b/apps/desktop-solid/package.json@@ -25,6 +25,7 @@"@solidjs/start": "^1.0.6","@tanstack/solid-query": "^5.51.21","@tauri-apps/api": ">=2.0.0-rc.0",+ "@tauri-apps/plugin-dialog": "2.0.0-rc.1","@tauri-apps/plugin-fs": "2.0.0-rc.0","@tauri-apps/plugin-shell": ">=2.0.0-rc.0","@types/react-tooltip": "^4.2.4",diff --git a/apps/desktop-solid/src-tauri/Cargo.toml b/apps/desktop-solid/src-tauri/Cargo.tomlindex c85f008d1..3d2bbd8fd 100644--- a/apps/desktop-solid/src-tauri/Cargo.toml+++ b/apps/desktop-solid/src-tauri/Cargo.toml@@ -16,7 +16,10 @@ tauri-build = { version = "2.0.0-rc", features = [] }swift-rs = { version = "1.0.6", features = ["build"] }[dependencies]-tauri = { version = "2.0.0-rc", features = [ "macos-private-api", "protocol-asset"] }+tauri = { version = "2.0.0-rc", features = [+ "macos-private-api",+ "protocol-asset",+] }tauri-plugin-shell = "2.0.0-rc"serde = { version = "1", features = ["derive"] }serde_json = "1"@@ -55,3 +58,4 @@ cap-project = { path = "../../../crates/project" }cap-rendering = { path = "../../../crates/rendering" }cap-ffmpeg = { path = "../../../crates/ffmpeg" }axum = { version = "0.7.5", features = ["ws"] }+tauri-plugin-dialog = "2.0.0-rc.0"diff --git a/apps/desktop-solid/src-tauri/capabilities/default.json b/apps/desktop-solid/src-tauri/capabilities/default.jsonindex 783eb2fec..2e31ea154 100644--- a/apps/desktop-solid/src-tauri/capabilities/default.json+++ b/apps/desktop-solid/src-tauri/capabilities/default.json@@ -18,6 +18,7 @@"core:window:allow-set-position","core:webview:allow-create-webview-window","shell:default",- "fs:default"+ "fs:default",+ "dialog:allow-save"]}diff --git a/apps/desktop-solid/src-tauri/src/lib.rs b/apps/desktop-solid/src-tauri/src/lib.rsindex ad52d1b63..a34574de1 100644--- a/apps/desktop-solid/src-tauri/src/lib.rs+++ b/apps/desktop-solid/src-tauri/src/lib.rs@@ -267,6 +267,7 @@ async fn get_rendered_video(editor_instance.path.join("output/result.mp4"),editor_instance.screen_decoder.clone(),editor_instance.camera_decoder.clone(),+ |_| {},).await?;@@ -332,7 +333,7 @@ impl EditorInstance {let render_options = RenderOptions {screen_recording_path: path.join("content/display.mp4"),- webcam_recording_path: path.join("content/camera.mp4"),+ camera_recording_path: path.join("content/camera.mp4"),screen_size: (meta.display.width, meta.display.height),camera_size: meta.camera.map(|c| (c.width, c.height)).unwrap_or((0, 0)),// webcam_style: WebcamStyle {@@ -912,15 +913,53 @@ fn focus_captures_panel(app: AppHandle) {panel.make_key_window();}-// #[tauri::command]-// #[specta::specta]-// async fn render_video(-// options: RenderOptions,-// project: ProjectConfiguration,-// output_path: PathBuf-// ) -> Result<PathBuf, String> {-// cap_rendering::render_video_to_file(options, project).await-// }+#[derive(Serialize, Deserialize, specta::Type, Clone)]+#[serde(tag = "type")]+enum RenderProgress {+ Starting { total_frames: u32 },+ FrameRendered { current_frame: u32 },+}++#[tauri::command]+#[specta::specta]+async fn render_to_file(+ app: AppHandle,+ output_path: PathBuf,+ video_id: String,+ project: ProjectConfiguration,+ progress_channel: tauri::ipc::Channel<RenderProgress>,+) {+ let video_dir = app+ .path()+ .app_data_dir()+ .unwrap()+ .join("recordings")+ .join(format!("{video_id}.cap"));++ let screen_recording_path = video_dir.join("content/display.mp4");+ let camera_recording_path = video_dir.join("content/camera.mp4");++ cap_rendering::render_video_to_file(+ RenderOptions {+ screen_recording_path: screen_recording_path.clone(),+ camera_recording_path: camera_recording_path.clone(),+ camera_size: (1920, 1080),+ screen_size: (3456, 2234),+ output_size: (1920, 1080),+ },+ project,+ output_path,+ OnTheFlyVideoDecoderActor::new(screen_recording_path),+ OnTheFlyVideoDecoderActor::new(camera_recording_path),+ move |current_frame| {+ progress_channel+ .send(RenderProgress::FrameRendered { current_frame })+ .ok();+ },+ )+ .await+ .ok();+}#[tauri::command]#[specta::specta]@@ -934,6 +973,16 @@ async fn set_playhead_position(app: AppHandle, video_id: String, frame_number: u.await;}+#[tauri::command]+#[specta::specta]+fn open_in_finder(path: PathBuf) {+ Command::new("open")+ .arg("-R")+ .arg(path)+ .spawn()+ .expect("Failed to open in Finder");+}+#[cfg_attr(mobile, tauri::mobile_entry_point)]pub fn run() {let specta_builder = tauri_specta::Builder::new()@@ -951,7 +1000,7 @@ pub fn run() {remove_fake_window,focus_captures_panel,get_current_recording,- // render_video,+ render_to_file,get_rendered_video,copy_rendered_video_to_clipboard,get_video_metadata,@@ -959,7 +1008,8 @@ pub fn run() {create_editor_instance,start_playback,stop_playback,- set_playhead_position+ set_playhead_position,+ open_in_finder]).events(tauri_specta::collect_events![RecordingOptionsChanged,@@ -980,6 +1030,7 @@ pub fn run() {tauri::Builder::default().plugin(tauri_plugin_shell::init()).plugin(tauri_nspanel::init())+ .plugin(tauri_plugin_dialog::init()).invoke_handler(specta_builder.invoke_handler()).setup(move |app| {specta_builder.mount_events(app);diff --git a/apps/desktop-solid/src/routes/editor/Editor.tsx b/apps/desktop-solid/src/routes/editor/Editor.tsxindex 7cc1ca392..db8f08c93 100644--- a/apps/desktop-solid/src/routes/editor/Editor.tsx+++ b/apps/desktop-solid/src/routes/editor/Editor.tsx@@ -25,7 +25,7 @@ import { Dynamic } from "solid-js/web";import { throttle } from "@solid-primitives/scheduled";import { trackDeep } from "@solid-primitives/deep";import { useSearchParams } from "@solidjs/router";-import { unwrap } from "solid-js/store";+import { createStore, reconcile, unwrap } from "solid-js/store";import { createElementBounds } from "@solid-primitives/bounds";import {@@ -52,6 +52,7 @@ import {import {commands,events,+ type RenderProgress,type AspectRatio,type BackgroundSource,type CursorType,@@ -71,7 +72,6 @@ const OUTPUT_SIZE = {};function Inner() {- const [params] = useSearchParams<{ path: string }>();const duration = 10;// const [playback, setPlayback] = createSignal({@@ -115,9 +115,7 @@ function Inner() {const [timelineRef, setTimelineRef] = createSignal<HTMLDivElement>();const timelineBounds = createElementBounds(timelineRef);- const { canvasRef, setCanvasRef, state } = useEditorContext();-- const videoId = () => params.path.split("/").at(-1)?.split(".")[0]!;+ const { canvasRef, setCanvasRef, state, videoId } = useEditorContext();onMount(() => {commands.createEditorInstance(videoId()).then((result) => {@@ -332,30 +330,92 @@ function Header() {class="flex flex-row gap-4 font-medium items-center"data-tauri-drag-region>- <Button- variant="secondary"- size="md"- onClick={async () => {- if (!params.path) return;- const pathParts = params.path.split("/");-- const fileName = pathParts.at(-1)?.split(".")[0];- if (!fileName) return;-- commands.renderVideoToChannel(fileName, unwrap(state));- }}- >- Render- </Button><ShareButton />- <Button variant="primary" size="md">- Save- </Button>+ <ExportButton /></div></header>);}+import { save } from "@tauri-apps/plugin-dialog";+import { Channel } from "@tauri-apps/api/core";++function ExportButton() {+ const { videoId, state: project } = useEditorContext();++ const [state, setState] = createStore<+ | { open: false; type: "idle" }+ | ({ open: boolean } & (+ | { type: "inProgress"; progress: number }+ | { type: "finished"; path: string }+ ))+ >({ open: false, type: "idle" });++ return (+ <>+ <Button+ variant="primary"+ size="md"+ onClick={() => {+ save({+ filters: [{ name: "mp4 filter", extensions: ["mp4"] }],+ }).then((p) => {+ if (!p) return;++ setState(+ reconcile({ open: true, type: "inProgress", progress: 0 })+ );++ const progress = new Channel<RenderProgress>();+ progress.onmessage = (p) => {+ if (p.type === "FrameRendered" && state.type === "inProgress")+ setState({ progress: p.current_frame });+ };++ return commands+ .renderToFile(p, videoId(), project, progress)+ .then(() => {+ setState({ ...state, type: "finished", path: p });+ });+ });+ }}+ >+ Export+ </Button>+ <Dialog.Root+ open={state.open}+ onOpenChange={(o) => {+ if (!o) setState(reconcile({ ...state, open: false }));+ }}+ >+ <DialogContent+ title="Export Recording"+ confirm={+ <Show when={state.type === "finished" && state}>+ {(state) => (+ <Button+ onClick={() => {+ commands.openInFinder(state().path);+ }}+ >+ Open in Finder+ </Button>+ )}+ </Show>+ }+ >+ <Switch>+ <Match when={state.type === "finished"}>Finished exporting</Match>+ <Match when={state.type === "inProgress" && state}>+ {(state) => <>Processed {state().progress} frames</>}+ </Match>+ </Switch>+ </DialogContent>+ </Dialog.Root>+ </>+ );+}+function ShareButton() {return (<buttondiff --git a/apps/desktop-solid/src/routes/editor/context.ts b/apps/desktop-solid/src/routes/editor/context.tsindex 3bc14861d..57e9a4756 100644--- a/apps/desktop-solid/src/routes/editor/context.ts+++ b/apps/desktop-solid/src/routes/editor/context.ts@@ -3,6 +3,7 @@ import { createSignal } from "solid-js";import { createStore } from "solid-js/store";import type { AspectRatio, ProjectConfiguration } from "../../utils/tauri";+import { useSearchParams } from "@solidjs/router";export const ASPECT_RATIOS = {wide: { name: "Wide", ratio: [16, 9] },@@ -60,6 +61,10 @@ export const [EditorContextProvider, useEditorContext] = createContextProvider(null);+ const [params] = useSearchParams<{ path: string }>();++ const videoId = () => params.path.split("/").at(-1)?.split(".")[0]!;+return {dialog,setDialog,@@ -69,6 +74,7 @@ export const [EditorContextProvider, useEditorContext] = createContextProvider(setSelectedTab,canvasRef,setCanvasRef,+ videoId,};// biome-ignore lint/style/noNonNullAssertion: context},diff --git a/apps/desktop-solid/src/utils/tauri.ts b/apps/desktop-solid/src/utils/tauri.tsindex 3bb9ce63e..ee067a5e8 100644--- a/apps/desktop-solid/src/utils/tauri.ts+++ b/apps/desktop-solid/src/utils/tauri.ts@@ -84,6 +84,9 @@ async getCurrentRecording() : Promise<Result<JsonValue<InProgressRecording | nulelse return { status: "error", error: e as any };}},+async renderToFile(outputPath: string, videoId: string, project: ProjectConfiguration, progressChannel: TAURI_CHANNEL<RenderProgress>) : Promise<void> {+ await TAURI_INVOKE("render_to_file", { outputPath, videoId, project, progressChannel });+},async getRenderedVideo(videoId: string, project: ProjectConfiguration) : Promise<Result<string, string>> {try {return { status: "ok", data: await TAURI_INVOKE("get_rendered_video", { videoId, project }) };@@ -132,6 +135,9 @@ async stopPlayback(videoId: string) : Promise<void> {},async setPlayheadPosition(videoId: string, frameNumber: number) : Promise<void> {await TAURI_INVOKE("set_playhead_position", { videoId, frameNumber });+},+async openInFinder(path: string) : Promise<void> {+ await TAURI_INVOKE("open_in_finder", { path });}}@@ -178,6 +184,7 @@ export type ProjectConfiguration = { aspectRatio: AspectRatio | null; backgroundexport type RecordingOptions = { captureTarget: CaptureTarget; cameraLabel: string | null }export type RecordingOptionsChanged = nullexport type RenderFrameEvent = { frame_number: number; project: ProjectConfiguration }+export type RenderProgress = { type: "Starting"; total_frames: number } | { type: "FrameRendered"; current_frame: number }export type ShowCapturesPanel = null/** tauri-specta globals **/diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.tomlindex ba1124c65..55964165b 100644--- a/apps/desktop/src-tauri/Cargo.toml+++ b/apps/desktop/src-tauri/Cargo.toml@@ -14,7 +14,7 @@ tauri-build = { version = "2.0.0-rc", features = [] }ffmpeg-sidecar = { git = "https://github.com/CapSoftware/ffmpeg-sidecar", branch = "main" }[dependencies]-tauri = { version = "=2.0.0-rc.0", features = [+tauri = { version = "2.0.0-rc.0", features = ["devtools","tray-icon","image-png",diff --git a/crates/rendering/src/lib.rs b/crates/rendering/src/lib.rsindex af683fcd6..ab7f459f0 100644--- a/crates/rendering/src/lib.rs+++ b/crates/rendering/src/lib.rs@@ -19,7 +19,7 @@ use std::time::Instant;#[derive(Debug, Clone, Serialize, Deserialize, Type)]pub struct RenderOptions {pub screen_recording_path: PathBuf,- pub webcam_recording_path: PathBuf,+ pub camera_recording_path: PathBuf,pub camera_size: (u32, u32),pub screen_size: (u32, u32),// pub webcam_style: WebcamStyle,@@ -98,6 +98,7 @@ pub async fn render_video_to_file(output_path: PathBuf,screen_recording_decoder: OnTheFlyVideoDecoderActor,camera_recording_decoder: OnTheFlyVideoDecoderActor,+ on_progress: impl Fn(u32) + Send + 'static,) -> Result<PathBuf, String> {let (tx_image_data, mut rx_image_data) = tokio::sync::mpsc::unbounded_channel::<Vec<u8>>();@@ -127,10 +128,14 @@ pub async fn render_video_to_file(let mut ffmpeg_process = ffmpeg.start();+ let mut frame_count = 0;loop {match rx_image_data.recv().await {Some(frame) => {// println!("Sending image data to FFmpeg");+ on_progress(frame_count);++ frame_count += 1;if let Err(e) = ffmpeg_process.write_video_frame(&frame) {eprintln!("Error writing video frame: {:?}", e);break;diff --git a/crates/rendering/src/main.rs b/crates/rendering/src/main.rsindex 568692411..afcc0ec3e 100644--- a/crates/rendering/src/main.rs+++ b/crates/rendering/src/main.rs@@ -31,7 +31,7 @@ async fn main() {render_video_to_file(cap_rendering::RenderOptions {screen_recording_path: project_path.join("content/display.mp4"),- webcam_recording_path: project_path.join("content/camera.mp4"),+ camera_recording_path: project_path.join("content/camera.mp4"),camera_size: meta.camera.map(|c| (c.width, c.height)).unwrap_or_default(),screen_size: (meta.display.width, meta.display.height),output_size: (1920, 1080),@@ -40,6 +40,7 @@ async fn main() {project_path.join("output/result.mp4"),OnTheFlyVideoDecoderActor::new(project_path.join("content/display.mp4").clone()),OnTheFlyVideoDecoderActor::new(project_path.join("content/camera.mp4").clone()),+ |_| {},).await.ok();diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 288c3c8a6..f9bb187bb 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -171,6 +171,9 @@ importers:'@tauri-apps/api':specifier: '>=2.0.0-rc.0'version: 2.0.0-rc.0+ '@tauri-apps/plugin-dialog':+ specifier: 2.0.0-rc.1+ version: 2.0.0-rc.1'@tauri-apps/plugin-fs':specifier: 2.0.0-rc.0version: 2.0.0-rc.0@@ -5128,6 +5131,9 @@ packages:resolution: {integrity: sha512-v454Qs3REHc3Za59U+/eSmBsdmF+3NE5+76+lFDaitVqN4ZglDHENDaMARYKGJVZuxiSkzyqG0SeG7lLQjVkPA==}engines: {node: '>= 18.18', npm: '>= 6.6.0', yarn: '>= 1.19.1'}+ '@tauri-apps/[email protected]':+ resolution: {integrity: sha512-UNiIhhKG08j4ooss2oEEVexffmWkgkYlC2M3GcX3VPtNsqFgVNL8Mcw/4Y7rO9M9S+ffAMnLOF5ypzyuyb8tyg==}+'@tauri-apps/[email protected]':resolution: {integrity: sha512-2NLSglDb5VfvTbMtmOKWyD+oaL/e8Z/ZZGovHtUFyUSFRabdXc6cZOlcD1BhFvYkHqm+TqGaz5qtPR5UbqDs8A==}engines: {node: '>= 10'}@@ -5258,6 +5264,9 @@ packages:engines: {node: '>= 10'}hasBin: true+ '@tauri-apps/[email protected]':+ resolution: {integrity: sha512-H28gh6BfZtjflHQ+HrmWwunDriBI3AQLAKnMs50GA6zeNUULqbQr7VXbAAKeJL/0CmWcecID4PKXVoSlaWRhEg==}+'@tauri-apps/[email protected]':resolution: {integrity: sha512-74VCXEZlzTJ+Jv1V3KrV0qIHhSePpE/ljsF78rcEuvSfyTxLtt/Sb5CIUmVhFlKTRFOH9dX50T4dTZ3qFLyRnA==}@@ -17312,6 +17321,8 @@ snapshots:'@tauri-apps/[email protected]': {}+ '@tauri-apps/[email protected]': {}+'@tauri-apps/[email protected]':optional: true@@ -17398,6 +17409,10 @@ snapshots:'@tauri-apps/cli-win32-ia32-msvc': 2.0.0-rc.0'@tauri-apps/cli-win32-x64-msvc': 2.0.0-rc.0+ '@tauri-apps/[email protected]':+ dependencies:+ '@tauri-apps/api': 2.0.0-rc.4+'@tauri-apps/[email protected]':dependencies:'@tauri-apps/api': 2.0.0-rc.0