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
|
||||
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
|
||||
run: ssh remote 'cd ${{ vars.DESTINATION_DIR }} && make run'
|
||||
|
||||
14
Makefile
14
Makefile
@@ -5,21 +5,27 @@ DEBUG_OUTPUT_DIR = $(PWD)/out
|
||||
build:
|
||||
docker build . -t $(APP_NAME)
|
||||
|
||||
debug:build
|
||||
mkdir -p $(OUTPUT_DIR)
|
||||
clean:
|
||||
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/final
|
||||
docker run \
|
||||
-it \
|
||||
--mount type=bind,source=$(PWD)/images,target=/home/node/app/images \
|
||||
--mount type=bind,source=$(DEBUG_OUTPUT_DIR),target=/home/node/app/out \
|
||||
--name $(APP_NAME) \
|
||||
$(APP_NAME)
|
||||
|
||||
run:build
|
||||
run: clean build
|
||||
mkdir -p $(OUTPUT_DIR)
|
||||
docker run \
|
||||
-d \
|
||||
--mount type=bind,source=$(OUTPUT_DIR),target=/home/node/app/out \
|
||||
--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();
|
||||
//remove video
|
||||
try {
|
||||
fs.unlinkSync('out/output.mp4');
|
||||
fs.unlinkSync('out/output.webm');
|
||||
} 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 -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) {
|
||||
reject(err);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user