mirror of
https://git.roussel.pro/public-website/singapore_rain_radar.git
synced 2026-02-09 02:20:17 +01:00
changed format to gif
This commit is contained in:
@@ -39,13 +39,13 @@ export async function createVideo() {
|
||||
await generateFinalImages();
|
||||
//remove video
|
||||
try {
|
||||
fs.unlinkSync('out/output.webm');
|
||||
fs.unlinkSync('out/output.gif');
|
||||
} catch (error) {
|
||||
console.log('No video to delete');
|
||||
}
|
||||
//run the command ffmpeg -framerate 5 -i %d.png -c:v libx264 -r 30 output.mp4
|
||||
return new Promise((resolve, reject) => {
|
||||
exec('ffmpeg -framerate 5 -i images/final/%d.png -c:v libvpx-vp9 -b:v 1M -r 30 out/output.webm', (err, stdout, stderr) => {
|
||||
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) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user