Server-side video processing with the native engine of CE.SDK’s Node.js package leverages native C++ performance and GPU acceleration. This guide covers resolution and duration limits, codec support, memory management, and hardware considerations for reliable video workflows.
The native engine of @cesdk/node supports GPU-accelerated video export. This enables server-side video rendering with native performance. The WASM engine, which @cesdk/node starts where the native engine cannot run, has no video export.
Video Export Support#
The native engine provides video export capabilities directly, without requiring the separate CE.SDK Renderer. Video encoding uses GPU acceleration via:
- Metal on macOS (ARM and x64)
- EGL on Linux (x64, ARM64)
- Direct3D 12 on Windows (x64)
Pass engine: 'native' to CreativeEngine.init() in a video pipeline. Initialization then fails where the native engine cannot run, instead of starting the WASM engine.
import CreativeEngine from '@cesdk/node';import fs from 'fs/promises';
const engine = await CreativeEngine.init({ license: 'YOUR_CESDK_LICENSE_KEY', // Fail instead of starting the WASM engine, which has no video export. engine: 'native',});
try { // Load a video scene await engine.scene.loadFromURL('https://example.com/video-scene.scene');
const [page] = engine.block.findByType('page');
// Export as MP4 video. The engine drives its update loop automatically // during the export — no manual pumping is required. const blob = await engine.block.exportVideo(page, { mimeType: 'video/mp4', targetWidth: 1920, targetHeight: 1080, framerate: 30, onProgress: (rendered, encoded, total) => { console.log( `Progress: ${rendered}/${total} rendered, ${encoded}/${total} encoded` ); } });
await fs.writeFile('./output.mp4', Buffer.from(await blob.arrayBuffer()));} finally { engine.dispose();}Resolution Limits#
Video resolution capabilities depend on hardware resources and GPU capabilities. CE.SDK supports up to 4K UHD for processing and export on capable hardware.
The maximum export size varies by hardware capabilities. Before exporting at high resolutions, verify the target dimensions don’t exceed hardware limits.
Duration Limits#
Video duration affects processing time and memory consumption. CE.SDK optimizes for short-form content while supporting longer videos with performance trade-offs.
Stories and reels up to 2 minutes are fully supported with efficient processing. Videos up to 10 minutes work well on modern hardware. Longer videos are technically possible but may increase memory usage and processing time.
For long-form content, consider these approaches:
- Split longer videos into shorter segments for processing
- Use lower resolution for intermediate processing, then export at full quality
- Monitor memory usage to establish acceptable duration limits for your server configuration
Frame Rate Support#
Frame rate affects processing time and output quality. Server environments can handle high frame rates without the real-time playback concerns of browser implementations.
30 FPS at 1080p is broadly supported and provides efficient processing. 60 FPS and high-resolution combinations require more processing time but are well-supported in server environments.
Variable frame rate sources may have timing precision limitations. For best results with variable frame rate content, consider transcoding to constant frame rate before processing.
Supported Codecs#
Video export produces .mp4 or .webm files. The VP8, VP9, AV1, Opus and Vorbis codecs of a WebM file are part of the package, so they need no codec libraries on the system.
On Linux x86_64, you can download a licensed codec pack from your licensing dashboard. The pack is not available for Linux ARM64, where video uses the open-source GStreamer codecs, which are meant for development. Extract it into a folder of its own, and set CESDK_CODEC_MODULES to that folder in the shell or through process.env before loading CE.SDK. CE.SDK then runs the licensed codecs in a separate process. See the Node Native setup guide for installation instructions and requirements.
Video Codecs#
H.264/AVC is the exportable video codec. On macOS, video is encoded in hardware through Apple VideoToolbox. On Linux, H.264 is encoded in software and may require additional codec libraries to be available in your environment.
On Linux without the licensed codec pack, and on Windows, the encoder takes a frame of at most 36,864 macroblocks of 16×16 pixels, which 4096×2304 fills exactly. On Windows each side is also at least 48 pixels. A larger or smaller export fails at once with CODEC.VIDEO_ENCODER_INVALID_RESOLUTION.
H.265/HEVC export is not available with the native engine.
Audio Codecs#
Audio in exported videos is encoded as AAC inside the .mp4 container.
For importing media, a wider range of codecs is supported — see the file format support list.
Hardware Considerations#
The native engine uses hardware resources directly, so it is faster than the WASM engine.
Recommended Server Specifications#
| Resource | Minimum | Recommended |
|---|---|---|
| Memory | 4 GB | 8+ GB for 4K content |
| CPU | 2 cores | 4+ cores for faster processing |
| GPU | Metal (macOS), EGL (Linux) or Direct3D 12 (Windows) | Dedicated GPU for best performance on Linux |
| Storage | SSD recommended | Fast I/O for video file handling |
GPU Requirements#
The native engine renders on the GPU by default and falls back to CPU rendering when no compatible GPU is available (the device: 'auto' default — see the configuration guide):
- macOS: Metal-compatible GPU (all Apple Silicon Macs, most Intel Macs). Video encoding runs in hardware through Apple VideoToolbox.
- Linux: EGL-compatible GPU with appropriate drivers installed. Video is encoded in software, so a GPU improves rendering but is not used for encoding.
- Windows: a GPU that runs Direct3D 12 at feature level 11_0. Video is encoded in software, so a GPU improves rendering but is not used for encoding. H.265 import through the GStreamer runtime decodes on the GPU through Direct3D 11.
Memory Constraints#
Server-side video processing operates within Node.js memory limits. Monitor consumption using standard Node.js APIs:
const memUsage = process.memoryUsage();console.log(`RSS: ${(memUsage.rss / 1024 / 1024).toFixed(1)} MB`);console.log(`Heap used: ${(memUsage.heapUsed / 1024 / 1024).toFixed(1)} MB`);Export Size Limitations#
Export dimensions are bounded by hardware texture size limits.
Common limits include:
- 4096 pixels: Basic configurations
- 8192 pixels: Most modern server hardware
- 16384 pixels: High-end GPU configurations
Troubleshooting#
| Issue | Cause | Solution |
|---|---|---|
| Export fails | Memory limits exceeded | Reduce resolution or split into segments |
| Codec not supported | Missing system codecs | Install required codec libraries |
| No GPU detected | Missing GPU drivers | Install Metal/EGL drivers for your platform |
| Slow processing | Insufficient hardware resources | Upgrade server specs or optimize content |