Rendering
Server Side Rendering

Server-Side Rendering

Server-side rendering (SSR) is a powerful strategy for video generation in the Montagix SDK, ensuring optimal performance and speed. By shifting the rendering process to the server, we can utilize dedicated resources, leading to a more efficient and faster video creation experience.

Overview

The digital landscape is ever-evolving, and with the rising demand for real-time video generation, the need for efficient rendering strategies has never been more prominent. SSR in the Montagix SDK is our answer to this challenge, offering unparalleled speed and optimization.

Server-Side Deployment

Montagix SDK is built with a scalable architecture that supports both client-side and server-side operations. For those looking to leverage server-side rendering and processing, we provide a robust infrastructure setup that can be deployed on AWS (Amazon Web Services). This setup encapsulates all the necessary services and configurations to run the Montagix SDK on a server environment, ensuring optimal performance and security for your video editing operations.

You can find the entire infrastructure setup, along with deployment instructions on our GitHub repository: Montagix SDK SSR Infrastructure on AWS (opens in a new tab).

By utilizing our server-side infrastructure, you can offload the heavy lifting to the server, ensuring smooth performance on client devices, and centralize your media processing tasks on a secure, reliable, and scalable platform.

Key Advantages

Enhanced Performance

With server-side rendering, we tap into robust server resources that are dedicated to the task at hand. This means faster processing times, quicker video generation, and less wait time for the end-user.

Scalability

SSR allows for scalability. Whether you're generating a single video or handling thousands of simultaneous requests, server-side rendering can manage the load, adjusting resources as required.

Consistency

By centralizing the rendering process, we ensure that every video is processed under the same conditions, resulting in consistent quality and performance.

Reduced Client Load

With SSR, the client's device is freed from the heavy lifting. This means smoother experiences for users, especially those on devices with limited processing power.

Security

Keeping the rendering process on the server side can add an additional layer of security. Since direct interactions with the rendering process are minimized, there's less room for interference or tampering.

Recommendation

While Montagix SDK provides multiple rendering strategies, we strongly recommend server-side rendering for most use cases. Its speed, efficiency, and consistency make it the ideal choice for ensuring the best user experience.

Example

Setting up

const engine = new Engine({
  resolution: [1080, 1920],
  storageProvider: new S3StorageProvider({
    serverUrl: process.env.SERVER_URL,
  }),
  renderingStrategy: new ServerSideRenderingStrategy({
    serverUrl: process.env.SERVER_URL,
  }),
});

Usage

const instance = engine.render();
 
instance.on("progress", (progress) => {
  console.log("progress", progress);
});
 
instance.on("complete", (video) => {
  console.log("video", video);
});
 
instance.on("error", (error) => {
  console.log("error", error);
});
 
instance.start();