From 88cfa312112cd270ac0a7c8c280b51fb822a05ea Mon Sep 17 00:00:00 2001 From: nahkd123 Date: Thu, 3 Oct 2024 01:10:45 +0700 Subject: [PATCH] Video rendering and encoding --- README.md | 7 +++- nahara-motion-ui/package.json | 3 +- nahara-motion-ui/src/ui/bar/TopBar.svelte | 49 ++++++++++++++++++++++- nahara-motion-video/.gitignore | 2 + nahara-motion-video/package.json | 22 ++++++++++ nahara-motion-video/src/encoder.ts | 28 +++++++++++++ nahara-motion-video/src/index.ts | 4 ++ nahara-motion-video/src/muxer.ts | 26 ++++++++++++ nahara-motion-video/src/pipeline.ts | 38 ++++++++++++++++++ nahara-motion-video/src/render.ts | 43 ++++++++++++++++++++ nahara-motion-video/tsconfig.json | 17 ++++++++ nahara-motion/package.json | 2 +- pnpm-lock.yaml | 31 ++++++++++++++ pnpm-workspace.yaml | 1 + 14 files changed, 269 insertions(+), 4 deletions(-) create mode 100644 nahara-motion-video/.gitignore create mode 100644 nahara-motion-video/package.json create mode 100644 nahara-motion-video/src/encoder.ts create mode 100644 nahara-motion-video/src/index.ts create mode 100644 nahara-motion-video/src/muxer.ts create mode 100644 nahara-motion-video/src/pipeline.ts create mode 100644 nahara-motion-video/src/render.ts create mode 100644 nahara-motion-video/tsconfig.json diff --git a/README.md b/README.md index 9dba57d..76b673a 100644 --- a/README.md +++ b/README.md @@ -33,4 +33,9 @@ cd nahara-motion-ui pnpm install pnpm dev # Open 127.0.0.1:5173 to see the app -``` \ No newline at end of file +``` + +## Modules +- `nahara-motion`: Nahara's Motion Engine +- `nahara-motion-ui`: The front-facing user interface for Nahara's Motion +- `nahara-motion-video`: Render and encode the scene to video file (`.mp4` in this case) diff --git a/nahara-motion-ui/package.json b/nahara-motion-ui/package.json index 4af96b9..37ee007 100644 --- a/nahara-motion-ui/package.json +++ b/nahara-motion-ui/package.json @@ -10,7 +10,8 @@ "check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json" }, "dependencies": { - "@nahara/motion": "workspace:*" + "@nahara/motion": "workspace:*", + "@nahara/motion-video": "workspace:*" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.1.1", diff --git a/nahara-motion-ui/src/ui/bar/TopBar.svelte b/nahara-motion-ui/src/ui/bar/TopBar.svelte index 2c08b37..b836c82 100644 --- a/nahara-motion-ui/src/ui/bar/TopBar.svelte +++ b/nahara-motion-ui/src/ui/bar/TopBar.svelte @@ -1,13 +1,60 @@