Server-side video processing with CE.SDK native Node.js bindings 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 Node.js bindings (@cesdk/node-native) support GPU-accelerated video export, unlike the WASM-based @cesdk/node package. This enables server-side video rendering with native performance.
Video Export Support#
The native bindings provide 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)
import CreativeEngine from '@cesdk/node-native';import fs from 'fs/promises';
const engine = await CreativeEngine.init({ license: 'YOUR_CESDK_LICENSE_KEY' });
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 — requires an update loop to pump encoding tasks const exportPromise = engine.block.exportVideo( page, 'video/mp4', (rendered, encoded, total) => { console.log( `Progress: ${rendered}/${total} rendered, ${encoded}/${total} encoded`, ); }, { targetWidth: 1920, targetHeight: 1080, framerate: 30 }, );
// Pump the engine update loop during export let exportComplete = false; exportPromise .then(() => { exportComplete = true; }) .catch(() => { exportComplete = true; }); while (!exportComplete) { engine.update(); await new Promise(r => setTimeout(r, 1)); }
// Awaiting the promise rethrows any export error const videoData = await exportPromise; await fs.writeFile('./output.mp4', Buffer.from(videoData));} 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 Codecs#
H.264/AVC in .mp4 containers has universal support and is the most reliable codec choice for broad compatibility.
H.265/HEVC in .mp4 containers has platform-dependent support. Availability varies by operating system and installed codec libraries.
Audio Codecs#
MP3 works in .mp3 files or within .mp4 containers, with universal support.
AAC in .m4a, .mp4, or .mov containers is widely supported, though some platforms may require additional codec libraries for encoding.
Hardware Considerations#
The native bindings leverage hardware resources directly, providing better performance than the WASM-based package.
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) or EGL (Linux) compatible | Dedicated GPU for best performance on Linux |
| Storage | SSD recommended | Fast I/O for video file handling |
GPU Requirements#
GPU acceleration is required for video export with the native bindings:
- macOS: Metal-compatible GPU (all Apple Silicon Macs, most Intel Macs with discrete GPUs)
- Linux: EGL-compatible GPU with appropriate drivers installed
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 |