Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
segment
Brendan Allanf9b3a787c16a
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rsindex db0c6ae2d..e68aff730 100644--- a/apps/desktop/src-tauri/src/recording.rs+++ b/apps/desktop/src-tauri/src/recording.rs@@ -212,13 +212,9 @@ async fn start_upload_loop(upload_tasks.push(tokio::spawn(async move {let filepath_str = segment_path_clone.to_str().unwrap_or_default().to_owned();println!("Uploading video: {}", filepath_str);- upload_file(- Some(options_clone),- filepath_str,- upload::FileType::VideoWithAudio,- )- .await- .map(|_| ())+ upload_file(Some(options_clone), filepath_str, upload::FileType::Segment)+ .await+ .map(|_| ())}));}watched_segments.insert(segment_filename.clone());diff --git a/apps/desktop/src-tauri/src/upload.rs b/apps/desktop/src-tauri/src/upload.rsindex d41543cc4..d24c3d581 100644--- a/apps/desktop/src-tauri/src/upload.rs+++ b/apps/desktop/src-tauri/src/upload.rs@@ -9,14 +9,14 @@ use crate::recording::RecordingOptions;use crate::utils::ffmpeg_path_as_str;pub enum FileType {- VideoWithAudio,+ Segment,Screenshot,}impl std::fmt::Display for FileType {fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {match self {- FileType::VideoWithAudio => write!(f, "video-with-audio"),+ FileType::Segment => write!(f, "segment"),FileType::Screenshot => write!(f, "screenshot"),}}@@ -52,7 +52,7 @@ pub async fn upload_file(let server_url = format!("{}/api/upload/signed", server_url_base);let body = match file_type {- FileType::VideoWithAudio => {+ FileType::Segment => {let (codec_name, width, height, frame_rate, bit_rate) = log_video_info(&file_path).map_err(|e| format!("Failed to log video info: {}", e))?;diff --git a/apps/web/app/api/upload/mux/create/route.ts b/apps/web/app/api/upload/mux/create/route.tsindex 6122648db..4de99e9e5 100644--- a/apps/web/app/api/upload/mux/create/route.ts+++ b/apps/web/app/api/upload/mux/create/route.ts@@ -97,7 +97,7 @@ export async function GET(request: NextRequest) {}const bucket = process.env.CAP_AWS_BUCKET || "";- const videoPrefix = `${userId}/${videoId}/video-with-audio/`;+ const segmentsPrefix = `${userId}/${videoId}/segment/`;try {const s3Client = new S3Client({@@ -108,18 +108,18 @@ export async function GET(request: NextRequest) {},});- const videoSegmentCommand = new ListObjectsV2Command({+ const segmentsCommand = new ListObjectsV2Command({Bucket: bucket,- Prefix: videoPrefix,+ Prefix: segmentsPrefix,});- const videoSegments = await s3Client.send(videoSegmentCommand);+ const segments = await s3Client.send(segmentsCommand);- const videoSegmentKeys = (videoSegments.Contents || []).map(+ const segmentKeys = (segments.Contents || []).map((object) => `s3://${bucket}/${object.Key}`);- if (videoSegmentKeys.length > 149) {+ if (segmentKeys.length > 149) {await db.update(videos).set({ skipProcessing: true })@@ -154,7 +154,7 @@ export async function GET(request: NextRequest) {const createJobCommand = new CreateJobCommand({Role: process.env.CAP_AWS_MEDIACONVERT_ROLE_ARN || "",Settings: {- Inputs: videoSegmentKeys.map((videoSegmentKey) => {+ Inputs: segmentKeys.map((videoSegmentKey) => {return {FileInput: videoSegmentKey,AudioSelectors: {