A Remotion video project featuring a rotating 3D monitor displaying scrolling "Hello World" code, built with React Three Fiber and server-side rendering capabilities.
This project creates a smooth 3D animation of a flat-screen monitor that:
- Rotates continuously in 3D space
- Displays scrolling code with syntax highlighting
- Renders at 1920x1080 @ 30fps
npm installRun the Remotion Studio to preview your video:
npm startThis will open the Remotion Studio in your browser where you can:
- Preview the animation in real-time
- Scrub through frames
- Adjust composition settings
Build the project for rendering:
npm run buildRender the Monitor3D composition to an MP4 file:
npx remotion render Monitor3D output.mp4Render with custom settings:
# High quality render
npx remotion render Monitor3D output.mp4 --quality 100
# Render specific frame range
npx remotion render Monitor3D output.mp4 --frames=0-150
# Render as image sequence
npx remotion render Monitor3D output --sequenceThis project supports server-side rendering using Remotion's Lambda or server rendering capabilities.
# Install Lambda
npm i @remotion/lambda
# Deploy to AWS Lambda
npx remotion lambda sites create
# Render on Lambda
npx remotion lambda render [site-id] Monitor3DCreate a simple Node.js server for rendering:
// render-server.js
const { bundle } = require("@remotion/bundler");
const { renderMedia, selectComposition } = require("@remotion/renderer");
const path = require("path");
const renderVideo = async () => {
const bundleLocation = await bundle({
entryPoint: path.join(__dirname, "src/index.ts"),
webpackOverride: (config) => config,
});
const composition = await selectComposition({
serveUrl: bundleLocation,
id: "Monitor3D",
});
await renderMedia({
composition,
serveUrl: bundleLocation,
codec: "h264",
outputLocation: `out/video-${Date.now()}.mp4`,
});
console.log("Render complete!");
};
renderVideo();Install required packages:
npm install @remotion/bundler @remotion/rendererRun the server:
node render-server.jsCreate a Dockerfile:
FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
CMD ["npx", "remotion", "render", "Monitor3D", "/output/video.mp4"]Build and run:
docker build -t remotion-3d .
docker run -v $(pwd)/output:/output remotion-3dEdit src/CodeTexture.tsx to change the scrolling code content:
const CODE_LINES = [
'console.log("Your custom code here");',
// Add more lines...
];Edit src/Monitor.tsx to customize:
- Monitor size and proportions
- Rotation speed
- Colors and materials
- Stand design
Edit src/Root.tsx:
<Composition
id="Monitor3D"
durationInFrames={300} // Change this value
fps={30}
// ...
/>remotion-3d/
βββ src/
β βββ Root.tsx # Composition registry
β βββ MonitorScene.tsx # Main 3D scene
β βββ Monitor.tsx # 3D monitor component
β βββ CodeTexture.tsx # Scrolling code texture
β βββ index.ts # Entry point
βββ public/ # Static assets
βββ build/ # Built bundle (generated)
βββ package.json
- Remotion - Video rendering framework
- React Three Fiber - React renderer for Three.js
- Three.js - 3D graphics library
- TypeScript - Type-safe development
See LICENSE.md for details.
Contributions welcome! Feel free to submit issues and pull requests.
Built with β€οΈ using Remotion and React Three Fiber