Skip to content

Commit

Permalink
braidz-process-video: test braidz output
Browse files Browse the repository at this point in the history
Until the previous commit 832bc1b, no
braidz file was created and the tests here would block forever.
  • Loading branch information
astraw committed Jan 11, 2025
1 parent 832bc1b commit b54ca45
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion braid-process-video/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ mod synced_iter;
mod config;
pub(crate) use config::FeatureDetectionMethod;
pub use config::{
BraidRetrackVideoConfig, OutputConfig, Valid, Validate, VideoOutputConfig, VideoSourceConfig,
BraidRetrackVideoConfig, BraidzOutputConfig, OutputConfig, Valid, Validate, VideoOutputConfig,
VideoSourceConfig,
};

mod auto_config_generator;
Expand Down
26 changes: 17 additions & 9 deletions braid-process-video/tests/test-montage.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use eyre::{self as anyhow};

use braid_process_video::{
BraidRetrackVideoConfig, OutputConfig, Valid, Validate, VideoOutputConfig, VideoSourceConfig,
BraidRetrackVideoConfig, BraidzOutputConfig, OutputConfig, Valid, Validate, VideoOutputConfig,
VideoSourceConfig,
};

const BASE_URL: &str = "https://strawlab-cdn.com/assets/flycube6-videos";
Expand All @@ -10,14 +11,16 @@ const SOURCE_JSON: &str = include_str!("source.json");
async fn do_config(cfg: &Valid<BraidRetrackVideoConfig>) -> anyhow::Result<()> {
// generate the output
let output_fnames = braid_process_video::run_config(cfg).await?;
assert_eq!(output_fnames.len(), 1);
let output_fname = output_fnames[0].clone();
assert_eq!(output_fnames.len(), 2);
let output_mp4 = output_fnames[0].clone();

// start parsing output
let do_decode_h264 = false;
let _src = frame_source::from_path(&output_fname, do_decode_h264)?;
let _src = frame_source::from_path(&output_mp4, do_decode_h264)?;

// TODO: check output. How?
// TODO: check output mp4. How?

// TODO: check output braidz

Ok(())
}
Expand Down Expand Up @@ -71,10 +74,15 @@ fn get_files(
}

let input_braidz = input_braidz.map(Into::into);
let output = vec![OutputConfig::Video(VideoOutputConfig {
filename: format!("tests/rendered/{}.mp4", dirname),
video_options: Default::default(),
})];
let output = vec![
OutputConfig::Video(VideoOutputConfig {
filename: format!("tests/rendered/{}.mp4", dirname),
video_options: Default::default(),
}),
OutputConfig::Braidz(BraidzOutputConfig {
filename: format!("tests/rendered/{dirname}.braidz"),
}),
];

let cfg = BraidRetrackVideoConfig {
input_braidz,
Expand Down

0 comments on commit b54ca45

Please sign in to comment.