Skip to content

Commit 7a99724

Browse files
authored
Hardware accelerated encoding on Windows (#976)
* venc-mediafoundation * not working for some reason? * de-thread scap-direct3d * something * rip original example * retry with scap-direct3d * a bunch of inversion of control * oops * path-based sample writer * bring back media processor * pass through format * reduce bitrate * reorganise * enc-* crates + use in studio recording * remove a bunch of unnecessary stuff * allow configuring bitrate * fix macos * cap-enc-gif * fix macos * imfsample -> avpacket wtf * work on instant mode * bruh * fix macos compile * wow audio works * fallback to ffmpeg encoder in instant mode too * address some coderabbit stuff * muxer::new * expect * formatting
1 parent 53403b2 commit 7a99724

File tree

80 files changed

+3682
-2513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3682
-2513
lines changed

Cargo.lock

Lines changed: 145 additions & 121 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,48 @@ anyhow = { version = "1.0.86" }
99
cpal = { git = "https://github.com/RustAudio/cpal", rev = "f43d36e55494993bbbde3299af0c53e5cdf4d4cf" }
1010
ffmpeg = { package = "ffmpeg-next", git = "https://github.com/CapSoftware/rust-ffmpeg", rev = "49db1fede112" }
1111
tokio = { version = "1.39.3", features = [
12-
"macros",
13-
"process",
14-
"fs",
15-
"sync",
16-
"rt",
17-
"rt-multi-thread",
18-
"time",
12+
"macros",
13+
"process",
14+
"fs",
15+
"sync",
16+
"rt",
17+
"rt-multi-thread",
18+
"time",
1919
] }
2020
tauri = { version = "2.5.0", features = ["specta"] }
2121
specta = { version = "=2.0.0-rc.20", features = [
22-
"derive",
23-
"serde_json",
24-
"uuid",
22+
"derive",
23+
"serde_json",
24+
"uuid",
2525
] }
2626
serde = { version = "1", features = ["derive"] }
2727

2828
scap = { git = "https://github.com/CapSoftware/scap", rev = "3cefe71561ff" }
2929
nokhwa = { git = "https://github.com/CapSoftware/nokhwa", rev = "b9c8079e82e2", features = [
30-
"input-native",
31-
"serialize",
30+
"input-native",
31+
"serialize",
3232
] }
3333
nokhwa-bindings-macos = { git = "https://github.com/CapSoftware/nokhwa", rev = "b9c8079e82e2" }
3434
wgpu = "25.0.0"
3535
flume = "0.11.0"
3636
thiserror = "1.0"
3737
sentry = { version = "0.34.0", features = [
38-
"anyhow",
39-
"backtrace",
40-
"debug-images",
38+
"anyhow",
39+
"backtrace",
40+
"debug-images",
4141
] }
4242
tracing = "0.1.41"
4343
futures = "0.3.31"
4444

4545
cidre = { git = "https://github.com/CapSoftware/cidre", rev = "bf84b67079a8", features = [
46-
"macos_13_0",
47-
"cv",
48-
"cf",
49-
"sc",
50-
"av",
51-
"blocks",
52-
"async",
53-
"dispatch",
46+
"macos_13_0",
47+
"cv",
48+
"cf",
49+
"sc",
50+
"av",
51+
"blocks",
52+
"async",
53+
"dispatch",
5454
], default-features = false }
5555

5656
windows = "0.60.0"
@@ -77,7 +77,7 @@ opt-level = "s" # Optimize for binary size
7777
debug = true
7878

7979
[patch.crates-io]
80-
screencapturekit = { git = "https://github.com/CapSoftware/screencapturekit-rs", rev = "7ff1e103742e56c8f6c2e940b5e52684ed0bed69" } # branch = "cap-main"
80+
# screencapturekit = { git = "https://github.com/CapSoftware/screencapturekit-rs", rev = "7ff1e103742e56c8f6c2e940b5e52684ed0bed69" } # branch = "cap-main"
8181
cidre = { git = "https://github.com/CapSoftware/cidre", rev = "bf84b67079a8" }
8282
# https://github.com/gfx-rs/wgpu/pull/7550
8383
# wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "cd41a6e32a6239b65d1cecbeccde6a43a100914a" }

apps/desktop/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ mp4 = "0.14.0"
5757
futures-intrusive = "0.5.0"
5858
anyhow.workspace = true
5959
futures = { workspace = true }
60-
axum = { version = "0.7.5", features = ["ws"] }
60+
axum = { version = "0.7.5", features = ["ws", "macros"] }
6161
tracing.workspace = true
6262
tempfile = "3.9.0"
6363
ffmpeg.workspace = true

apps/desktop/src-tauri/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,17 +2235,17 @@ pub async fn run(recording_logging_handle: LoggingHandle) {
22352235
})
22362236
.build(tauri_context)
22372237
.expect("error while running tauri application")
2238-
.run(move |handle, event| match event {
2238+
.run(move |_handle, event| match event {
22392239
#[cfg(target_os = "macos")]
22402240
tauri::RunEvent::Reopen { .. } => {
2241-
let has_window = handle.webview_windows().iter().any(|(label, _)| {
2241+
let has_window = _handle.webview_windows().iter().any(|(label, _)| {
22422242
label.starts_with("editor-")
22432243
|| label.as_str() == "settings"
22442244
|| label.as_str() == "signin"
22452245
});
22462246

22472247
if has_window {
2248-
if let Some(window) = handle
2248+
if let Some(window) = _handle
22492249
.webview_windows()
22502250
.iter()
22512251
.find(|(label, _)| {
@@ -2258,7 +2258,7 @@ pub async fn run(recording_logging_handle: LoggingHandle) {
22582258
window.set_focus().ok();
22592259
}
22602260
} else {
2261-
let handle = handle.clone();
2261+
let handle = _handle.clone();
22622262
tokio::spawn(async move {
22632263
let _ = ShowCapWindow::Main.show(&handle).await;
22642264
});

apps/web/app/(org)/dashboard/caps/components/Folders.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { Fit, Layout, RiveFile, useRive } from "@rive-app/react-canvas";
3+
import { Fit, Layout, type RiveFile, useRive } from "@rive-app/react-canvas";
44
import React, { useImperativeHandle } from "react";
55
import { useTheme } from "../../Contexts";
66

0 commit comments

Comments
 (0)