mirror of
https://git.roussel.pro/public-website/singapore_rain_radar.git
synced 2026-02-09 02:20:17 +01:00
changed codec to VP9 and fixed ffmpeg cmd
This commit is contained in:
@@ -33,8 +33,5 @@ jobs:
|
|||||||
- name: Upload files
|
- name: Upload files
|
||||||
run: rsync -rvp --chown=quentin:users --chmod=777 --exclude=.gitea --exclude=.git ${{ vars.RSYNC_ARGS }} . remote:${{ vars.DESTINATION_DIR }}
|
run: rsync -rvp --chown=quentin:users --chmod=777 --exclude=.gitea --exclude=.git ${{ vars.RSYNC_ARGS }} . remote:${{ vars.DESTINATION_DIR }}
|
||||||
|
|
||||||
- name: Remove old container
|
|
||||||
run: docker kill $(docker ps -aq --filter ancestor=sg_rain_radar) && docker rm $(docker ps -aq --filter ancestor=sg_rain_radar)
|
|
||||||
|
|
||||||
- name: Run container
|
- name: Run container
|
||||||
run: ssh remote 'cd ${{ vars.DESTINATION_DIR }} && make run'
|
run: ssh remote 'cd ${{ vars.DESTINATION_DIR }} && make run'
|
||||||
|
|||||||
14
Makefile
14
Makefile
@@ -5,21 +5,27 @@ DEBUG_OUTPUT_DIR = $(PWD)/out
|
|||||||
build:
|
build:
|
||||||
docker build . -t $(APP_NAME)
|
docker build . -t $(APP_NAME)
|
||||||
|
|
||||||
debug:build
|
clean:
|
||||||
mkdir -p $(OUTPUT_DIR)
|
docker stop $(APP_NAME)
|
||||||
|
docker rm $(APP_NAME)
|
||||||
|
|
||||||
|
debug: clean build
|
||||||
|
mkdir -p $(DEBUG_OUTPUT_DIR)
|
||||||
mkdir -p $(PWD)/images/raw
|
mkdir -p $(PWD)/images/raw
|
||||||
mkdir -p $(PWD)/images/final
|
mkdir -p $(PWD)/images/final
|
||||||
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=$(DEBUG_OUTPUT_DIR),target=/home/node/app/out \
|
--mount type=bind,source=$(DEBUG_OUTPUT_DIR),target=/home/node/app/out \
|
||||||
|
--name $(APP_NAME) \
|
||||||
$(APP_NAME)
|
$(APP_NAME)
|
||||||
|
|
||||||
run:build
|
run: clean build
|
||||||
mkdir -p $(OUTPUT_DIR)
|
mkdir -p $(OUTPUT_DIR)
|
||||||
docker run \
|
docker run \
|
||||||
-d \
|
-d \
|
||||||
--mount type=bind,source=$(OUTPUT_DIR),target=/home/node/app/out \
|
--mount type=bind,source=$(OUTPUT_DIR),target=/home/node/app/out \
|
||||||
|
--name $(APP_NAME) \
|
||||||
$(APP_NAME)
|
$(APP_NAME)
|
||||||
|
|
||||||
.PHONY: build debug run
|
.PHONY: build debug run clean
|
||||||
BIN
out/output.webm
Normal file
BIN
out/output.webm
Normal file
Binary file not shown.
@@ -39,13 +39,13 @@ export async function createVideo() {
|
|||||||
await generateFinalImages();
|
await generateFinalImages();
|
||||||
//remove video
|
//remove video
|
||||||
try {
|
try {
|
||||||
fs.unlinkSync('out/output.mp4');
|
fs.unlinkSync('out/output.webm');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('No video to delete');
|
console.log('No video to delete');
|
||||||
}
|
}
|
||||||
//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 libvpx -r 30 out/output.webm', (err, stdout, stderr) => {
|
exec('ffmpeg -framerate 5 -i images/final/%d.png -c:v libvpx-vp9 -b:v 1M -r 30 out/output.webm', (err, stdout, stderr) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(err);
|
reject(err);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user