Your complete guide to rendering videos from the command line. Learn essential commands, output formats, quality settings, batch rendering, and automation techniques for production-ready video workflows.
Get started with the essential Remotion CLI commands for rendering videos and generating stills from your compositions.
The core command for rendering videos is npx remotion render <composition-id>. This renders your composition to the default out folder as an MP4 file.
Control where your video is saved by adding an output path: npx remotion render MyVideo ./output/video.mp4. You can also use the --output flag for clarity.
Render a composition named 'Intro' to a specific location: npx remotion render Intro ./renders/intro-final.mp4
Generate a single frame as an image with npx remotion still MyVideo output.png. Use --frame=30 to specify which frame to capture.
Pass custom props to your composition using --props='{ "title": "Hello" }' for inline JSON, or --props=./props.json to load from a file.
Load environment variables from a file with --env-file=.env.production. This is useful for managing API keys and configuration across environments.
Choose the right video codec and container format for your use case, from web-optimized MP4 to professional ProRes masters.
Select your codec with the --codec flag. Each codec offers different tradeoffs between quality, file size, and compatibility.
| Codec | Format | Best For |
|---|---|---|
| h264 | MP4 | Web, universal playback |
| h265 | MP4 | Smaller files, modern devices |
| vp8 | WebM | Web, open format |
| vp9 | WebM | High quality web video |
| prores | MOV | Professional editing |
Use --codec=h264 for maximum compatibility. This is the default codec and works on virtually all devices and platforms.
For professional workflows, render with ProRes: npx remotion render MyVideo --codec=prores --prores-profile=hq. Available profiles: 4444-xq, 4444, hq, standard, light, proxy.
Set the audio codec independently with --audio-codec. Options include aac (default, best compatibility), mp3, and wav (uncompressed).
Export as individual frames instead of a video with --sequence. Customize naming with --image-sequence-pattern='frame_[frame].[ext]'.
For modern browsers with smaller file sizes: npx remotion render MyVideo output.webm --codec=vp9
Fine-tune video quality, compression, and file size to achieve the perfect balance for your delivery requirements.
CRF controls the quality-to-size ratio. Lower values mean higher quality and larger files. The scale is 0-51, with 23 being the default.
Use --crf=18 for high-quality renders where file size isn't a concern. For web delivery, --crf=23 offers a good balance.
Create a high-quality master file: npx remotion render MyVideo master.mp4 --crf=18 --image-format=png
For precise file size control, use bitrate instead of CRF: --video-bitrate=5M for 5 Mbps or --video-bitrate=2500K for 2.5 Mbps.
Control audio quality with --audio-bitrate=320k for high quality or --audio-bitrate=192k for standard quality. Higher bitrates preserve audio fidelity.
Optimize for web delivery: npx remotion render MyVideo web.mp4 --codec=h264 --crf=23 --audio-codec=aac --audio-bitrate=192k
Render multiple compositions efficiently using scripts, loops, and parallel processing techniques.
Create a shell script to render multiple compositions sequentially. This is the simplest approach for batch rendering a known set of videos.
Create a render-all.sh script that renders each composition with consistent settings. Run with bash render-all.sh to process all videos.
Control CPU usage with --concurrency. Use --concurrency=4 for 4 threads, --concurrency=50% for half your cores, or --concurrency=100% for maximum speed.
Render the same composition with different props by creating multiple JSON files and looping through them: for f in props/*.json; do npx remotion render MyVideo --props="$f"; done
Use GNU Parallel for concurrent batch rendering: parallel npx remotion render {} ::: Comp1 Comp2 Comp3. This renders multiple compositions simultaneously.
For large batches, reduce concurrency to prevent out-of-memory errors: --concurrency=2 --image-format=jpeg. JPEG frames use less memory than PNG.
Integrate Remotion rendering into automated workflows, CI/CD pipelines, and programmatic video generation systems.
The CLI returns exit code 0 on success and non-zero on failure. Use this in scripts to detect errors: npx remotion render MyVideo || echo 'Render failed'
Add rendering to your CI pipeline by installing dependencies and running the render command. Use --gl=angle on Linux servers without GPU for software rendering.
In your workflow file, install dependencies with npm ci, then render with npx remotion render MyVideo --gl=angle. Upload artifacts to store the output.
Use the @remotion/renderer package for Node.js integration. The renderMedia() function provides full control over rendering with TypeScript support.
When using the Node.js API, pass an onProgress callback to track rendering progress. This enables progress bars and status updates in your application.
Trigger renders via webhooks by creating an API endpoint that calls renderMedia(). Return the video URL or upload to cloud storage when complete.
Continue exploring with these related guides and tutorials.



Now that you've mastered CLI rendering, explore Lambda deployment for serverless video generation or browse our template library for your next project.