Uppergraph is a command-line interface (CLI) video compositing and rendering engine, designed to be part of animation studio pipelines. It uses HTML as a portable format, allowing artists and directors to review and composite scenes using standard web technologies.
Make sure you have run npm install uppergraph.
# Render a scene to mp4
npx uppergraph index.html -o output.mp4
# Render in Watch mode (re-renders when detecting changes in HTML)
npx uppergraph index.html -wUppergraph parses an HTML file looking for custom elements. All other HTML elements will be ignored unless they are inside <ug-text>.
Defines the global render metadata.
width: Video width (default: 1920)height: Video height (default: 1080)fps: Frames per second (default: 30)duration: Duration in seconds (default: 5)
Example: <ug-scene width="1280" height="720" fps="60" duration="10"></ug-scene>
Both <ug-video> and <ug-text> support dynamic transform properties. You can use fixed numbers or math expressions based on time t (in seconds).
x: X position (e.g.,200ort * 100)y: Y positionscaleX: Horizontal scale (default: 1)scaleY: Vertical scale (default: 1)rotation: Rotation in degrees (e.g.,t * 45)skewX: Horizontal skew in degreesskewY: Vertical skew in degreesoriginX: Horizontal origin point for transformations (e.g.,100orw/2)originY: Vertical origin point for transformationsz-index: Layer order (lower values go behind)
Note: All these properties can be JavaScript expressions using t (current time in seconds) and Math.
Inserts a video layer into the composition.
src: Path to the video relative to the HTML file.width/height: Forces the video to render at a specific resolution.
You can nest <ug-filter> elements inside <ug-video> to apply post-processing.
- chroma-key: Removes a specific background color (green screen) based on RGB Euclidean distance (Native, super fast).
- CamanJS Filters: Integrates the
CamanJSlibrary with filters likebrightness,contrast,sepia,saturation, etc. Use the filter name astypeand the amount asvalue.
<ug-video src="assets/greenscreen.mp4" z-index="1" x="t * 50">
<ug-filter type="chroma-key" color="#00FF00"></ug-filter>
<ug-filter type="brightness" value="10"></ug-filter>
<ug-filter type="contrast" value="15"></ug-filter>
</ug-video>Inserts an audio track into the composition through FFmpeg mixing. This element is not visually rendered but affects the final .mp4 file.
src: Path to the audio file.delay: Audio delay in seconds before it starts playing.
<ug-audio src="assets/music.mp3" delay="2.5"></ug-audio>Inserts text or HTML content with full CSS support.
- Rendered via SVG
foreignObject, therefore, respects the document's classes and<style>. - Supports all dynamic attributes (
x,y,scaleX,scaleY,rotation,skewX,skewY).
Animated text example:
<ug-text z-index="2" x="400 + Math.cos(t * 2) * 50" y="300" rotation="t * 90" class="my-class">
Hello Uppergraph!
</ug-text>