Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Merge branch 'main' into pr/171

Richie McIlroy26ba4d31ebce
diff --cc apps/desktop/src-tauri/src/lib.rs
index 520a7484b,13d252c9b..e47271c21
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@@ -21,9 -21,9 +21,9 @@@ use auth::{AuthStore, AuthenticationInv
use cap_editor::{EditorInstance, FRAMES_WS_PATH};
use cap_editor::{EditorState, ProjectRecordings};
use cap_media::feeds::{AudioInputFeed, AudioInputSamplesSender};
-use cap_media::sources::CaptureScreen;
+use cap_media::sources::{CaptureScreen, CaptureWindow};
use cap_media::{
- feeds::{AudioFrameBuffer, CameraFeed, CameraFrameSender},
+ feeds::{CameraFeed, CameraFrameSender},
sources::ScreenCaptureTarget,
};
use cap_project::{ProjectConfiguration, RecordingMeta, SharingMeta};
@@@ -1083,12 -1031,7 +1059,12 @@@ async fn render_to_file
video_id: String,
project: ProjectConfiguration,
progress_channel: tauri::ipc::Channel<RenderProgress>,
+) {
+ sentry::configure_scope(|scope| {
+ scope.set_tag("cmd", "render_to_file");
+ });
+
+ ) -> Result<PathBuf, String> {
let (duration, _size) =
get_video_metadata(app.clone(), video_id.clone(), Some(VideoType::Screen))
.await
@@@ -1099,9 -1042,14 +1075,15 @@@
let editor_instance = upsert_editor_instance(&app, video_id.clone()).await;
+ let export_result = cap_export::export_video_to_file(
+ let output_path = editor_instance
+ .project_path
+ .join("output")
+ .join("result.mp4");
+
+ cap_export::export_video_to_file(
project,
- output_path,
+ output_path.clone(),
move |current_frame| {
if current_frame == 0 {
progress_channel
@@@ -1118,12 -1066,12 +1100,16 @@@
editor_instance.render_constants.clone(),
editor_instance.cursor.clone(),
)
+ .await;
+ if let Err(err) = export_result {
+ sentry::capture_message(&err, sentry::Level::Error);
+ }
+ .await
+ .map_err(|e| e.to_string())?;
ShowCapturesPanel.emit(&app).ok();
+
+ Ok(output_path)
}
#[tauri::command]