npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gorenku/compositions

v0.1.24

Published

Shared Remotion compositions and renderers for Renku

Readme

@gorenku/compositions

Shared Remotion compositions and renderers for Renku video generation

npm version License: MIT Remotion

Remotion-based video rendering components and timeline document format for Renku. Supports both browser and Node.js environments for video playback and export.

Overview

@gorenku/compositions provides the video rendering layer for Renku using Remotion. It defines:

  • Timeline document format - JSON structure for representing video timelines
  • Remotion compositions - React components for rendering video content
  • Track system - Support for image, audio, video, music, and caption tracks
  • Effects system - Built-in effects like Ken Burns pan/zoom
  • Dual environment support - Works in both browser (via Remotion Player) and Node.js (via @remotion/renderer)

This package is designed for developers who want to customize video rendering or build alternative viewers.

Installation

npm install @gorenku/compositions

Key Exports

Compositions

  • DocumentaryComposition - Main video composition component
  • DocumentaryRoot - Remotion root component configuration
  • DOCUMENTARY_COMPOSITION_ID - Composition identifier constant

Types

  • TimelineDocument - Main timeline structure
  • Track Types: ImageTrack, AudioTrack, MusicTrack, VideoTrack, CaptionsTrack
  • Clip Types: ImageClip, AudioClip, MusicClip, VideoClip, CaptionsClip
  • KenBurnsEffect - Image pan/zoom effect definition
  • AssetMap - Asset reference mapping

Utilities

  • remapSpeed() - Speed adjustment utilities for timeline clips

Entry Points

  • Main export (index.ts) - Full composition exports for Node.js
  • Browser export (browser.ts) - Browser-safe composition exports

Timeline Document Format

The timeline document is a JSON structure that describes the complete video composition:

{
  fps: 30,                    // Frames per second
  durationInFrames: 600,      // Total duration in frames
  width: 1920,                // Video width
  height: 1080,               // Video height
  tracks: [
    {
      kind: "Image",          // Track type
      clips: [
        {
          id: "image-1",
          start: 0,            // Start frame
          duration: 150,       // Duration in frames
          src: "image.png",    // Asset reference
          effect: {            // Optional effect
            kind: "KenBurns",
            from: { x: 0, y: 0, scale: 1 },
            to: { x: 100, y: 50, scale: 1.2 }
          }
        }
      ]
    },
    {
      kind: "Audio",
      clips: [
        {
          id: "audio-1",
          start: 0,
          duration: 150,
          src: "narration.mp3",
          volume: 0.8         // Optional volume (0-1)
        }
      ]
    }
  ]
}

Supported Track Types

  • ImageTrack - Static images with optional effects (Ken Burns, etc.)
  • AudioTrack - Narration or sound effects
  • MusicTrack - Background music
  • VideoTrack - Video clips
  • CaptionsTrack - Subtitles and captions

Supported Effects

  • KenBurns - Pan and zoom effects for images
    • Define start and end positions (x, y, scale)
    • Smooth interpolation between keyframes

Usage Example

Browser Playback (Remotion Player)

import { Player } from '@remotion/player';
import { DocumentaryComposition } from '@gorenku/compositions/browser';
import type { TimelineDocument } from '@gorenku/compositions';

const timeline: TimelineDocument = {
  fps: 30,
  durationInFrames: 600,
  width: 1920,
  height: 1080,
  tracks: [
    // Your tracks here
  ]
};

const assetMap = {
  'image.png': '/path/to/image.png',
  'narration.mp3': '/path/to/audio.mp3'
};

function App() {
  return (
    <Player
      component={DocumentaryComposition}
      inputProps={{ timeline, assetMap }}
      durationInFrames={timeline.durationInFrames}
      fps={timeline.fps}
      compositionWidth={timeline.width}
      compositionHeight={timeline.height}
    />
  );
}

Server-Side Rendering (Node.js)

import { bundle } from '@remotion/bundler';
import { renderMedia } from '@remotion/renderer';
import { DocumentaryRoot } from '@gorenku/compositions';

// Bundle the composition
const bundled = await bundle({
  entryPoint: DocumentaryRoot,
  webpackOverride: (config) => config
});

// Render to video
await renderMedia({
  composition: {
    id: 'documentary',
    fps: 30,
    durationInFrames: 600,
    width: 1920,
    height: 1080
  },
  serveUrl: bundled,
  codec: 'h264',
  outputLocation: './output.mp4',
  inputProps: {
    timeline,
    assetMap
  }
});

Development

Setup

# Clone the monorepo
git clone https://github.com/yourusername/renku.git
cd renku

# Install dependencies
pnpm install

Build

# Build the compositions package
pnpm --filter @gorenku/compositions build

# Watch mode for development
pnpm --filter @gorenku/compositions dev

Type Checking

# Type check the package
pnpm --filter @gorenku/compositions type-check

Project Structure

compositions/
├── src/
│   ├── compositions/        # Remotion composition components
│   │   └── documentary/     # Documentary composition
│   ├── remotion/            # Remotion configuration
│   ├── lib/                 # Utility libraries
│   │   └── remotion/        # Remotion utilities
│   ├── types/               # TypeScript type definitions
│   │   └── timeline.ts      # Timeline document types
│   ├── index.ts             # Main entry point (Node.js)
│   └── browser.ts           # Browser entry point
├── dist/                    # Build output
└── package.json

Rendering with Remotion CLI

You can also use the Remotion CLI directly:

# Install Remotion CLI
npm install -g @remotion/cli

# Render a composition
remotion render src/index.ts documentary output.mp4 \
  --props='{"timeline": ..., "assetMap": ...}'

Contributing

When contributing to the compositions package:

  • Follow Remotion best practices for performance
  • Ensure effects are smooth and GPU-accelerated where possible
  • Test compositions in both browser and Node.js environments
  • Follow the coding conventions in CLAUDE.md
  • Add tests for new composition types or effects

License

MIT