| 1 | test("Parse uses fractional input fps for total frame estimates", () => { |
| 2 | const parser = new Parse(); |
| 3 | |
| 4 | parser.onLine("Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':"); |
| 5 | parser.onLine(" Duration: 00:01:08.10, start: 0.000000, bitrate: 352 kb/s"); |
| 6 | parser.onLine( |
| 7 | " Stream #0:0[0x1](und): Video: h264, yuv420p(progressive), 160x90, 351 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)", |
| 8 | ); |
| 9 | |
| 10 | const result = parser.onLine( |
| 11 | "frame= 2041 fps=0.0 q=-1.0 Lsize=N/A time=00:01:08.10 bitrate=N/A speed= 900x", |
| 12 | ); |
| 13 | |
| 14 | assert.equal(result.kind, "progress"); |
| 15 | assert.equal(result.totalFrames, 2041); |
| 16 | }); |
| 17 | |
| 18 | import assert from "node:assert"; |
| 19 | import { test } from "vitest"; |
| 20 | import { Parse } from "./ffmpeg.ts"; |