B19: ec-bench seek every extract (shared SEEK_SECONDS=30); -ss 60 exceeds the 52.2s fixtures (ffprobe) and yielded 0 bytes
Browse files at this commitc96fce6c392254005ddc07873f582419a5018f4eParent: 9f44fb41 changed file +7 -5
tools/ec-bench/src/main.rsmodified+7 -5
| @@ -83,6 +83,8 @@ fn media_dir() -> PathBuf { | |||
| 83 | .map_or_else(ec_testkit::root, PathBuf::from) | 83 | .map_or_else(ec_testkit::root, PathBuf::from) |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | +const SEEK_SECONDS: &str = "30"; | ||
| 87 | + | ||
| 86 | fn real_video(codec: &str) -> Option<PathBuf> { | 88 | fn real_video(codec: &str) -> Option<PathBuf> { |
| 87 | let name = match codec { | 89 | let name = match codec { |
| 88 | "h264" => "open/sintel_trailer-1080p.mp4", | 90 | "h264" => "open/sintel_trailer-1080p.mp4", |
| @@ -210,7 +212,7 @@ fn bench_h264(rows: &mut Vec<Row>) -> ec_core::Result<()> { | |||
| 210 | /// ffmpeg. | 212 | /// ffmpeg. |
| 211 | fn extract_yuv420p(src: &Path, w: u32, h: u32, n: u32) -> (Vec<u8>, u32, u32, u32) { | 213 | fn extract_yuv420p(src: &Path, w: u32, h: u32, n: u32) -> (Vec<u8>, u32, u32, u32) { |
| 212 | let out = ec_testkit::ffmpeg() | 214 | let out = ec_testkit::ffmpeg() |
| 213 | - .args(["-v", "error", "-i"]) | 215 | + .args(["-v", "error", "-ss", SEEK_SECONDS, "-i"]) |
| 214 | .arg(src) | 216 | .arg(src) |
| 215 | .args([ | 217 | .args([ |
| 216 | "-vf", | 218 | "-vf", |
| @@ -439,19 +441,19 @@ fn bench_hw_av1_encode_10bit(rows: &mut Vec<Row>) { | |||
| 439 | rows.push(Row { | 441 | rows.push(Row { |
| 440 | component: "ec-hw av1 10-bit", | 442 | component: "ec-hw av1 10-bit", |
| 441 | direction: "encode", | 443 | direction: "encode", |
| 442 | - content: format!("{w}x{h} yuv420p10le, {n} frames from 00:01:00, CQP 120, {} kB", coded / 1000), | 444 | + content: format!("{w}x{h} yuv420p10le, {n} frames from 00:00:30, CQP 120, {} kB", coded / 1000), |
| 443 | media: format!("{media_s:.1}s"), | 445 | media: format!("{media_s:.1}s"), |
| 444 | wall_ms: wall * 1000.0, | 446 | wall_ms: wall * 1000.0, |
| 445 | rtf: (wall > 0.0).then_some(media_s / wall), | 447 | rtf: (wall > 0.0).then_some(media_s / wall), |
| 446 | }); | 448 | }); |
| 447 | } | 449 | } |
| 448 | 450 | ||
| 449 | -/// `extract_yuv420p` at ten bits, planar 16-bit little endian, seeked a | 451 | +/// `extract_yuv420p` at ten bits, planar 16-bit little endian, seeked |
| 450 | -/// minute in: frame 0 of a film is its black leader, and a black leader codes | 452 | +/// into the clip: frame 0 of a film is its black leader, and a black leader codes |
| 451 | /// to nothing and benchmarks nothing. | 453 | /// to nothing and benchmarks nothing. |
| 452 | fn extract_yuv420p10(src: &Path, w: u32, h: u32, n: u32) -> Vec<u8> { | 454 | fn extract_yuv420p10(src: &Path, w: u32, h: u32, n: u32) -> Vec<u8> { |
| 453 | let out = ec_testkit::ffmpeg() | 455 | let out = ec_testkit::ffmpeg() |
| 454 | - .args(["-v", "error", "-ss", "60", "-i"]) | 456 | + .args(["-v", "error", "-ss", SEEK_SECONDS, "-i"]) |
| 455 | .arg(src) | 457 | .arg(src) |
| 456 | .args([ | 458 | .args([ |
| 457 | "-vf", &format!("scale={w}:{h}"), | 459 | "-vf", &format!("scale={w}:{h}"), |