Convert Markdown to video presentations using Remotion.
motion.md is a library that takes specially-formatted Markdown with YAML frontmatter and generates professional-looking video presentations using Remotion. The library parses global video configuration and per-slide settings from the Markdown and renders a video presentation.
npm install motion.md
# or
yarn add motion.md
# or
pnpm add motion.md
Create a markdown file with frontmatter configuration:
---
title: My Video Presentation
output: video.mp4
fps: 30
resolution:
width: 1920
height: 1080
transition: fade
---
layout: intro
voiceover: Discover motion.md - the future of dynamic video generation
---
# Welcome to motion.md
This is a powerful tool for creating videos from Markdown.
---
voiceover: Markdown-based workflow explained.
layout: cover
---
## Features
- Markdown-based workflow
- Slidev syntax compatibility
- Video output with Remotion
---
background: stock:mountains.jpg
voiceover: Here are some amazing features.
transition: slide
---
## Advanced Configuration
This slide uses nested frontmatter for configuration.
Using the CLI:
npx motion.md render presentation.md --output video.mp4
Using the API:
import { parseMarkdownWithFrontmatter, createVideoFromSlides } from 'motion.md'
// Parse the markdown
const { globalConfig, slides } = parseMarkdownWithFrontmatter(markdownContent)
// Generate the video
const result = await createVideoFromSlides({
slides,
config: globalConfig,
outputPath: 'output.mp4',
options: {
tts: true,
quality: 'production'
}
})
console.log(`Video generated at ${result.outputPath}`)
- Markdown-based workflow: Create videos using familiar Markdown syntax
- Nested frontmatter: Configure global settings and per-slide options
- Multiple layouts: Support for intro, cover, and default slide layouts
- Media components: Embed images, videos, and browser screenshots
- Voiceover support: Add narration to your slides
- Transition effects: Apply transitions between slides
- Background customization: Use colors or images as slide backgrounds
Parses Markdown content with frontmatter into slides and configuration.
Generates a video from parsed slides using Remotion.
# Render a markdown file to video
motion.md render <input> [options]
# Options:
# -o, --output <path> Output file path
# -q, --quality <quality> Video quality (draft or production)
# --no-tts Disable text-to-speech
- Remotion - Video rendering engine
- gray-matter - Frontmatter parsing
- unified - Markdown processing