Compare commits

..

No commits in common. "9b6b5547baea22315f3224522f3bff5bd3a1c252" and "33b6bbb2161e488f7de1edefd6ff122ddcd2ca8d" have entirely different histories.

7 changed files with 2140 additions and 1007 deletions

View file

@ -1,2 +1 @@
*/node_modules
Earthfile

View file

@ -7,18 +7,18 @@ avsync-video-components:
RUN npm install -g pnpm
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser && mkdir /home/pptruser && chown -R pptruser:pptruser /home/pptruser
USER pptruser
COPY package.json pnpm-lock.yaml /site
WORKDIR /site
CACHE --id=pnpm /home/pptruser/.local/share/pnpm
RUN pnpm install --frozen-lockfile
COPY . /site
COPY av-sync/package.json av-sync/pnpm-lock.yaml /av-sync
WORKDIR /av-sync
CACHE /home/pptruser/.local/share/pnpm
RUN pnpm install
COPY av-sync /av-sync
ARG FPS=60
ARG CYCLES=16
ARG SIZE=1200
RUN pnpm av:render:video --fps $FPS --cycles 1 --size $SIZE --output /var/tmp/frames
RUN pnpm av:render:audio -i beep.wav -o /var/tmp/track.wav --repeats $CYCLES
SAVE ARTIFACT /var/tmp/frames
SAVE ARTIFACT /var/tmp/track.wav
RUN pnpm serve-render --fps $FPS --cycles 1 --size $SIZE --output frames
RUN pnpm render-audio -i beep.wav -o track.wav --repeats $CYCLES
SAVE ARTIFACT frames
SAVE ARTIFACT track.wav
avsync-video:
FROM debian:bookworm
@ -36,8 +36,8 @@ site:
RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml /site
WORKDIR /site
CACHE --id=pnpm $HOME/.local/share/pnpm
RUN pnpm install --frozen-lockfile --prod
CACHE $HOME/.local/share/pnpm
RUN pnpm install --frozen-lockfile
COPY . /site
RUN pnpm build
SAVE ARTIFACT build AS LOCAL build

29
av-sync/package.json Normal file
View file

@ -0,0 +1,29 @@
{
"name": "av-sync",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"render": "node render.js",
"serve-render": "concurrently -P -k -s command-1 \"pnpm run dev --port 8626\" \"wait-on http://localhost:8626 && pnpm run render --url http://localhost:8626 {@}\" --",
"render-audio": "node render-audio.js"
},
"dependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@tsconfig/svelte": "^5.0.2",
"commander": "^12.0.0",
"concurrently": "^8.2.2",
"node-wav": "^0.0.2",
"puppeteer": "^22.1.0",
"svelte": "^4.2.10",
"svelte-check": "^3.6.3",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^5.1.0",
"wait-on": "^7.2.0"
}
}

2066
av-sync/pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff

View file

@ -40,7 +40,7 @@ for (let frame = 0; frame < totalFrames; frame++) {
const path = `${options.output}/${frame.toString().padStart(Math.log10(totalFrames) + 1, '0')}.png`;
await page.screenshot({ path, omitBackground: true });
let end = Date.now();
console.log(`Captured frame ${frame + 1}/${totalFrames} (took ${end - start}ms)`);
console.log(`Captured frame ${frame}/${totalFrames} (took ${end - start}ms)`);
}
console.log('Done.');

View file

@ -9,41 +9,32 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"av:dev": "cd av-sync && vite",
"av:render:video": "cd av-sync && concurrently -P -k -s command-1 \"vite --port 8626\" \"wait-on http://localhost:8626 && node render-video.js --url http://localhost:8626 {@}\" --",
"av:render:audio": "cd av-sync && node render-audio.js"
"format": "prettier --write ."
},
"devDependencies": {
"@tsconfig/svelte": "^5.0.2",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "8.56.0",
"@types/lodash": "^4.14.202",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"commander": "^12.0.0",
"concurrently": "^8.2.2",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"node-wav": "^0.0.2",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"puppeteer": "^22.1.0",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"wait-on": "^7.2.0"
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3"
},
"type": "module",
"dependencies": {
"@fontsource/b612": "^5.0.8",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"lodash": "^4.17.21",
"normalize.css": "^8.0.1",
"svelte": "^4.2.7",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3"
"normalize.css": "^8.0.1"
}
}

File diff suppressed because it is too large Load diff