@reshotdev/screenshot 0.0.1-beta.1 → 0.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2330,6 +2330,33 @@ async function runScenarioWithVideoCapture(scenario, options = {}) {
|
|
|
2330
2330
|
)
|
|
2331
2331
|
);
|
|
2332
2332
|
|
|
2333
|
+
// Extract poster frame from the video (first frame at 0.5s for non-blank content)
|
|
2334
|
+
const posterPath = finalVideoPath.replace(/\.mp4$/, "-poster.png");
|
|
2335
|
+
try {
|
|
2336
|
+
await runFFmpegConvert([
|
|
2337
|
+
"-i",
|
|
2338
|
+
finalVideoPath,
|
|
2339
|
+
"-ss",
|
|
2340
|
+
"0.5",
|
|
2341
|
+
"-frames:v",
|
|
2342
|
+
"1",
|
|
2343
|
+
"-q:v",
|
|
2344
|
+
"2",
|
|
2345
|
+
"-y",
|
|
2346
|
+
posterPath,
|
|
2347
|
+
]);
|
|
2348
|
+
if (fs.existsSync(posterPath)) {
|
|
2349
|
+
const posterSize = fs.statSync(posterPath).size;
|
|
2350
|
+
console.log(
|
|
2351
|
+
chalk.green(
|
|
2352
|
+
` ✔ Poster frame: ${posterPath} (${(posterSize / 1024).toFixed(1)} KB)`
|
|
2353
|
+
)
|
|
2354
|
+
);
|
|
2355
|
+
}
|
|
2356
|
+
} catch (e) {
|
|
2357
|
+
debug(`Poster frame extraction failed: ${e.message}`);
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2333
2360
|
// Save timeline for reference
|
|
2334
2361
|
const timelinePath = path.join(
|
|
2335
2362
|
outputDir || path.join(".reshot/output", scenario.key, "default"),
|