diff --git a/tests/integration.rs b/tests/integration.rs index e00ac62..2a3cd7f 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -165,7 +165,10 @@ mod integration { ); assert!(!res.contains("Non-monotonous DTS")); - assert!(get_video_info(&format!("data/{}/output.mp4", test_name)).contains("28 fps")); + assert_eq!( + get_video_fps(&format!("data/{}/output.mp4", test_name)), + "28/1" + ); check_for_merged_file(test_name, "output.mp4"); } @@ -185,7 +188,10 @@ mod integration { ); assert!(!res.contains("Non-monotonous DTS")); - assert!(get_video_info(&format!("data/{}/output.mp4", test_name)).contains("25 fps")); + assert_eq!( + get_video_fps(&format!("data/{}/output.mp4", test_name)), + "25/1" + ); check_for_merged_file(test_name, "output.mp4"); } @@ -207,7 +213,10 @@ mod integration { .success(), ); - assert!(get_video_info(&format!("data/{}/output.mp4", test_name)).contains("60 fps")); + assert_eq!( + get_video_fps(&format!("data/{}/output.mp4", test_name)), + "60/1" + ); check_for_merged_file(test_name, "output.mp4"); } @@ -265,8 +274,22 @@ mod integration { .unwrap(); } - fn get_video_info(file_path: &str) -> String { - let output = Command::new("ffmpeg").arg("-i").arg(file_path).output(); - String::from_utf8_lossy(&output.unwrap().stderr).to_string() + fn get_video_fps(file_path: &str) -> String { + let output = Command::new("ffprobe") + .args(&[ + "-v", + "error", + "-select_streams", + "v:0", + "-show_entries", + "stream=r_frame_rate", + "-of", + "default=noprint_wrappers=1:nokey=1", + file_path, + ]) + .output() + .unwrap(); + + String::from_utf8(output.stdout).unwrap().trim().to_string() } }