The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
fix(export): the folder the file goes in is made, and a phone's sheet has no Browse
Jareer38e45a9e59e8
diff --git a/src/crates/concat-export/src/lib.rs b/src/crates/concat-export/src/lib.rsindex 03ecf01e..cfc127d4 100644--- a/src/crates/concat-export/src/lib.rs+++ b/src/crates/concat-export/src/lib.rs@@ -951,6 +951,16 @@ pub fn render_on(.file_stem().map_or_else(|| "concat".into(), |s| s.to_string_lossy());let directory = output.parent().unwrap_or(Path::new("."));+ // The folder the file goes in is made when it is not there. A phone's+ // Movies folder under the app's own files does not exist until the+ // first export, and every phone's first export stopped at "no such+ // file or directory" before a frame was drawn (#280, #147).+ if let Err(error) = std::fs::create_dir_all(directory) {+ return Err(format!(+ "could not create the folder {}: {error}",+ directory.display()+ ));+ }let silent = directory.join(format!(".{stem}.concat-video.mp4"));let mixed = directory.join(format!(".{stem}.concat-audio.m4a"));@@ -2408,6 +2418,75 @@ mod tests {let _ = std::fs::remove_file(&path);}+ /// The folder the file goes in is made by the export: a phone's+ /// Movies folder does not exist until the first export (#280).+ #[test]+ fn an_export_makes_the_folder_it_writes_into() {+ use concat_core::frame::Frame;+ use concat_media::{EncodeOptions, Encoder, FrameSink};++ let root = std::env::temp_dir().join(format!(+ "concat-export-folder-{}-{}",+ std::process::id(),+ std::time::SystemTime::now()+ .duration_since(std::time::UNIX_EPOCH)+ .map_or(0, |since| since.as_nanos())+ ));+ let source = std::env::temp_dir().join("concat-export-folder-source.mp4");+ let Ok(mut encoder) = Encoder::create(+ &source,+ 64,+ 64,+ FrameRate::THIRTY,+ &EncodeOptions::default(),+ ) else {+ return; // no ffmpeg here+ };+ for _ in 0..6 {+ encoder.write_frame(&Frame::black(64, 64)).expect("writes");+ }+ encoder.finish().expect("finishes");++ let mut footage = clip("video", 0, 0.0, 0.2, 0.0);+ footage.path = source.to_string_lossy().into_owned();+ footage.media_width = Some(64);+ footage.media_height = Some(64);+ let nested = root.join("Movies").join("Concat");+ let request = ExportRequest {+ output: nested.join("out.mp4").to_string_lossy().into_owned(),+ width: 64,+ height: 64,+ rate_num: 30,+ rate_den: 1,+ crf: 30,+ preset: "ultrafast".into(),+ codec: VideoCodec::H264,+ ten_bit: false,+ rate_mode: RateMode::Vbr,+ bitrate_kbps: 0,+ color_range: concat_media::ColorRange::Limited,+ color_space: ColorSpace::Sdr,+ hdr: false,+ clips: vec![footage],+ };+ assert!(!nested.exists());+ let cancel = AtomicBool::new(false);+ let mut progress = |_: i64, _: i64, _: &'static str| {};+ let reporter = Reporter {+ progress: &mut progress,+ cancel: &cancel,+ };+ // Whether or not this machine can draw the frames, the folder is+ // there before the first one is asked for.+ let result = render_on(&request, None, reporter);+ assert!(nested.is_dir(), "the export makes its folder: {result:?}");+ if result.is_ok() {+ assert!(nested.join("out.mp4").is_file());+ }+ let _ = std::fs::remove_dir_all(&root);+ let _ = std::fs::remove_file(&source);+ }+/// A device that dies under an export is replaced: first by a fresh/// one on the GPU, then by the software adapter; the third death ends/// the export with a message that says how many there were.diff --git a/src/crates/concat/ui/dialogs/export.slint b/src/crates/concat/ui/dialogs/export.slintindex d5c92583..6be2eb27 100644--- a/src/crates/concat/ui/dialogs/export.slint+++ b/src/crates/concat/ui/dialogs/export.slint@@ -303,6 +303,9 @@ component SummarySection inherits DialogSection {component DestinationSection inherits DialogSection {in property <ExportData> data;+ /// A phone has no folder picker: the file goes where the path under+ /// the field says, so there is no Browse to press.+ in property <bool> phone;callback name-edited(name: string);callback browse();@@ -316,7 +319,7 @@ component DestinationSection inherits DialogSection {edited(text) => { root.name-edited(text); }}- Button {+ if !root.phone: Button {label: I18n.t("export.browse");glyph: Glyph.import;clicked => { root.browse(); }@@ -537,6 +540,8 @@ component ExportFooter inherits VerticalLayout {/// The button runs the footer's width on a phone, and keeps to a/// button's width on a desk, where the width would make it a banner.in property <bool> narrow;+ /// A phone has no file manager to show the file in.+ in property <bool> phone;callback begin();callback cancel();@@ -639,7 +644,7 @@ component ExportFooter inherits VerticalLayout {spacing: 6px;alignment: start;- Button {+ if !root.phone: Button {label: I18n.t("export.showInFolder");glyph: Glyph.import;clicked => { root.reveal(); }@@ -829,6 +834,7 @@ export component ExportDialog inherits Rectangle {SummarySection { first: true; data: root.data; }if !root.running: DestinationSection {data: root.data;+ phone: root.phone;name-edited(name) => { root.name-edited(name); }browse => { root.browse(); }}@@ -875,6 +881,7 @@ export component ExportDialog inherits Rectangle {SummarySection { data: root.data; }DestinationSection {data: root.data;+ phone: root.phone;name-edited(name) => { root.name-edited(name); }browse => { root.browse(); }}@@ -941,6 +948,7 @@ export component ExportDialog inherits Rectangle {}DestinationSection {data: root.data;+ phone: root.phone;name-edited(name) => { root.name-edited(name); }browse => { root.browse(); }}@@ -980,6 +988,7 @@ export component ExportDialog inherits Rectangle {ExportFooter {data: root.data;narrow: root.columns == 1;+ phone: root.phone;begin => { root.begin(); }cancel => { root.cancel(); }reveal => { root.reveal(); }