Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

test(verify): check editing exports through transition blends, same-clip cross-fade case, FFmpeg transition xfails

Richie McIlroyb29a39c193e9
diff --git a/crates/verify/expectations.toml b/crates/verify/expectations.toml
index 5b8314a71..03ec940cb 100644
--- a/crates/verify/expectations.toml
+++ b/crates/verify/expectations.toml
@@ -206,3 +206,27 @@ case = "editing/export/multi-segment/seed-7"
class = "stale"
reason = "FFmpeg decoder (full tier): after the timeline played clip 0 from 1.68 s to its end and then transitions back into clip 0 at 0 s, the 10 frames after the transition show source frame 0 instead of 20-29 (deterministic). Same mechanism as the seek/*/storm*/ffmpeg xfail: backward seeks near the start answer frame 0"
link = ""
+
+[[xfail]]
+case = "editing/export/same-clip-transition/forward/ffmpeg"
+class = "stale"
+reason = "NEW: FFmpeg decoder, cross-fade between two parts of the same recording clip (0-2 s, then 3-5.5 s, 0.8 s transition): the export reads one decoder at two positions interleaved and every third blend frame takes the far side from the near position (frame 37: incoming should be source 90, shows 35; up to 55 source frames stale). Deterministic; AVAssetReader passes this case (its 60 fps variant is the */basic/transition/*60*/avf xfail)"
+link = ""
+
+[[xfail]]
+case = "editing/export/basic/seed-5"
+class = "stale"
+reason = "FFmpeg decoder, same-clip cross-fade (see editing/export/same-clip-transition/forward/ffmpeg): blend frame 53 one source frame stale"
+link = ""
+
+[[xfail]]
+case = "editing/export/basic/seed-23"
+class = "stale"
+reason = "FFmpeg decoder (full tier), same-clip cross-fade (see editing/export/same-clip-transition/forward/ffmpeg): blend frames up to 70 source frames stale"
+link = ""
+
+[[xfail]]
+case = "editing/export/multi-segment/seed-7"
+class = "unreadable"
+reason = "FFmpeg decoder (full tier): one blend frame of the transition back into clip 0 mixes two stale frames and its marker is unreadable (same bug as the stale entry above)"
+link = ""
diff --git a/crates/verify/tests/editing.rs b/crates/verify/tests/editing.rs
index 926e6f2c0..e13f03808 100644
--- a/crates/verify/tests/editing.rs
+++ b/crates/verify/tests/editing.rs
@@ -353,7 +353,7 @@ fn export_cases(spec: cap_verify::fixture::FixtureSpec, seeds: u64) -> Vec<Strin
)) {
Err(e) => case.problem("error", format!("export failed: {e}")),
Ok(out) => {
- let frames = common::read_output(&out);
+ let frames = common::read_output(&out, Some(&|i| model.expect(i as u32, fps)));
common::check_sequence(&mut case, &model, &frames, fps, true);
}
}
@@ -375,6 +375,57 @@ fn export_multi_clip() {
));
}
+/// A cross-fade between two parts of the same recording clip: the export
+/// reads one decoder at two positions, interleaved, for the whole
+/// transition. Forward (later part incoming) and backward.
+#[test]
+fn same_clip_transition_export() {
+ let project = common::project(&catalog::basic(report::tier()));
+ let rt = common::runtime();
+ let fps = 30;
+ let mut failures = Vec::new();
+ for (name, cuts) in [
+ ("forward", [(0.0, 2.0, 1.0), (3.0, 5.5, 1.0)]),
+ ("backward", [(3.0, 5.5, 1.0), (0.5, 2.5, 1.0)]),
+ ] {
+ for decoder in Decoder::all() {
+ let id = format!(
+ "editing/export/same-clip-transition/{name}/{}",
+ decoder.label()
+ );
+ if !report::selected(&id) {
+ continue;
+ }
+ let mut config = project.config();
+ common::set_cuts(&mut config, &cuts);
+ common::add_transition(&mut config, 1, 0.8);
+ let model = project.model(&config);
+ let mut case = Case::new(&id);
+ let dir = common::scratch_dir(&id);
+ let run = ExportRun {
+ fps,
+ resolution: (320, 180),
+ format: Format::Mp4,
+ decoder,
+ };
+ match rt.block_on(common::export(
+ &project,
+ config,
+ &run,
+ &dir.path().join("out.mp4"),
+ )) {
+ Err(e) => case.problem("error", format!("export failed: {e}")),
+ Ok(out) => {
+ let frames = common::read_output(&out, Some(&|i| model.expect(i as u32, fps)));
+ common::check_sequence(&mut case, &model, &frames, fps, true);
+ }
+ }
+ failures.extend(settle(case));
+ }
+ }
+ common::assert_passed(failures);
+}
+
/// Deterministic repro for `editing/mapping/duration-covered`: a 1 s
/// fullscreen text card at 5.4 s, then the clip trimmed to 3.2 s. The
/// timeline reports 4.2 s; the export must have as many frames.
@@ -409,7 +460,7 @@ fn hold_past_end_export() {
)) {
Err(e) => case.problem("error", format!("export failed: {e}")),
Ok(out) => {
- let frames = common::read_output(&out).len();
+ let frames = common::read_output(&out, None).len();
let expected = (duration * f64::from(fps)).ceil() as usize;
if frames == expected {
case.note(format!("{frames} frames for the {duration:.3}s timeline"));