Added delay after the last image, fix #4

This commit is contained in:
Quentin Roussel
2025-09-19 18:05:35 +08:00
parent 30974eb85f
commit 900b09bbbf

View File

@@ -48,7 +48,7 @@ export async function createVideo() {
} }
//run the command ffmpeg -framerate 5 -i %d.png -c:v libx264 -r 30 output.mp4 //run the command ffmpeg -framerate 5 -i %d.png -c:v libx264 -r 30 output.mp4
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
exec('ffmpeg -framerate 5 -i images/final/%d.png -vf "fps=5,scale=853:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 out/output.gif', (err, stdout, stderr) => { exec('ffmpeg -framerate 5 -i images/final/%d.png -vf "fps=5,tpad=stop_mode=clone:stop_duration=2,scale=853:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 out/output.gif', (err, stdout, stderr) => {
if (err) { if (err) {
reject(err); reject(err);
return; return;