(buffer: Buffer | undefined)
| 1089 | async function probeAnimatedInfo(buffer: Buffer): Promise<{ fps: number; duration: number }> { |
| 1090 | const tmpBase = path.join(os.tmpdir(), `telebox_quote_probe_${Date.now()}_${Math.random().toString(16).slice(2)}`); |
| 1091 | const input = `${tmpBase}.bin`; |
| 1092 | try { |
| 1093 | fs.writeFileSync(input, buffer); |
| 1094 | const out = await execFileCaptureAsync("ffprobe", [ |
| 1095 | "-v", "error", |
| 1096 | "-select_streams", "v:0", |
| 1097 | "-show_entries", "stream=avg_frame_rate,r_frame_rate,duration:format=duration", |
| 1098 | "-of", "default=noprint_wrappers=1:nokey=0", |
| 1099 | input, |
| 1100 | ], 10000); |
| 1101 | const data = new Map<string, string>(); |
| 1102 | out.split(/\r?\n/).forEach((line) => { |
| 1103 | const idx = line.indexOf("="); |
| 1104 | if (idx > 0) data.set(line.slice(0, idx), line.slice(idx + 1)); |
| 1105 | }); |
no test coverage detected