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 | 83 | .map_or_else(ec_testkit::root, PathBuf::from) |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | +const SEEK_SECONDS: &str = "30"; | |
| 87 | + | |
| 86 | 88 | fn real_video(codec: &str) -> Option<PathBuf> { |
| 87 | 89 | let name = match codec { |
| 88 | 90 | "h264" => "open/sintel_trailer-1080p.mp4", |
| @@ -210,7 +212,7 @@ fn bench_h264(rows: &mut Vec<Row>) -> ec_core::Result<()> { | ||
| 210 | 212 | /// ffmpeg. |
| 211 | 213 | fn extract_yuv420p(src: &Path, w: u32, h: u32, n: u32) -> (Vec<u8>, u32, u32, u32) { |
| 212 | 214 | let out = ec_testkit::ffmpeg() |
| 213 | - .args(["-v", "error", "-i"]) | |
| 215 | + .args(["-v", "error", "-ss", SEEK_SECONDS, "-i"]) | |
| 214 | 216 | .arg(src) |
| 215 | 217 | .args([ |
| 216 | 218 | "-vf", |
| @@ -439,19 +441,19 @@ fn bench_hw_av1_encode_10bit(rows: &mut Vec<Row>) { | ||
| 439 | 441 | rows.push(Row { |
| 440 | 442 | component: "ec-hw av1 10-bit", |
| 441 | 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 | 445 | media: format!("{media_s:.1}s"), |
| 444 | 446 | wall_ms: wall * 1000.0, |
| 445 | 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 | |
| 450 | -/// minute in: frame 0 of a film is its black leader, and a black leader codes | |
| 451 | +/// `extract_yuv420p` at ten bits, planar 16-bit little endian, seeked | |
| 452 | +/// into the clip: frame 0 of a film is its black leader, and a black leader codes | |
| 451 | 453 | /// to nothing and benchmarks nothing. |
| 452 | 454 | fn extract_yuv420p10(src: &Path, w: u32, h: u32, n: u32) -> Vec<u8> { |
| 453 | 455 | let out = ec_testkit::ffmpeg() |
| 454 | - .args(["-v", "error", "-ss", "60", "-i"]) | |
| 456 | + .args(["-v", "error", "-ss", SEEK_SECONDS, "-i"]) | |
| 455 | 457 | .arg(src) |
| 456 | 458 | .args([ |
| 457 | 459 | "-vf", &format!("scale={w}:{h}"), |