updated video codec

This commit is contained in:
Quentin Roussel
2024-08-18 20:09:36 +08:00
parent 84ee2eb724
commit a02cdd801e
2 changed files with 3 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
APP_NAME = "sg_rain_radar" APP_NAME = "sg_rain_radar"
OUTPUT_DIR = /var/www/html/other/sg_rain_radar/ OUTPUT_DIR = /var/www/html/other/sg_rain_radar/
DEBUG_OUTPUT_DIR = $(PWD)/out
build: build:
docker build . -t $(APP_NAME) docker build . -t $(APP_NAME)
@@ -11,7 +12,7 @@ debug:build
docker run \ docker run \
-it \ -it \
--mount type=bind,source=$(PWD)/images,target=/home/node/app/images \ --mount type=bind,source=$(PWD)/images,target=/home/node/app/images \
--mount type=bind,source=$(OUTPUT_DIR),target=/home/node/app/out \ --mount type=bind,source=$(DEBUG_OUTPUT_DIR),target=/home/node/app/out \
$(APP_NAME) $(APP_NAME)
run:build run:build

View File

@@ -45,7 +45,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 -c:v h264 -r 30 out/output.mp4', (err, stdout, stderr) => { exec('ffmpeg -framerate 5 -i images/final/%d.png -c:v libvpx -r 30 out/output.mp4', (err, stdout, stderr) => {
if (err) { if (err) {
reject(err); reject(err);
return; return;