mirror of
https://git.roussel.pro/public-website/singapore_rain_radar.git
synced 2026-02-09 02:20:17 +01:00
made the docker image lighter and changed the video codec
This commit is contained in:
@@ -6,6 +6,9 @@ jobs:
|
|||||||
copy:
|
copy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Test if destination directory variable is set
|
||||||
|
if: ${{vars.DESTINATION_DIR == '' }}
|
||||||
|
run: exit 1
|
||||||
- name: Configure SSH
|
- name: Configure SSH
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.ssh/
|
mkdir -p ~/.ssh/
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
FROM node:18
|
FROM node:18-alpine
|
||||||
|
|
||||||
# Set TZ to Singapore to help with syncronizing with singapore's website time
|
# Set TZ to Singapore to help with syncronizing with singapore's website time
|
||||||
ENV TZ="Asia/Singapore"
|
ENV TZ="Asia/Singapore"
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y ffmpeg && apt-get clean
|
RUN apk update && apk add --no-cache ffmpeg npm pango-dev g++ make jpeg-dev giflib-dev librsvg-dev
|
||||||
|
|
||||||
RUN mkdir -p /home/node/app/node_modules
|
RUN mkdir -p /home/node/app/node_modules
|
||||||
RUN mkdir -p /home/node/app/images/raw
|
RUN mkdir -p /home/node/app/images/raw
|
||||||
|
|||||||
@@ -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 libx264 -r 30 out/output.mp4', (err, stdout, stderr) => {
|
exec('ffmpeg -framerate 5 -i images/final/%d.png -c:v h264 -r 30 out/output.mp4', (err, stdout, stderr) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(err);
|
reject(err);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user