Capítulo 144 de 988
_Part of the @remotion/renderer package.
const composition: VideoConfig = {
durationInFrames: 1000000,
fps: 30,
height: 720,
id: 'react-svg',
width: 1280,
defaultProps: {},
props: {},
defaultCodec: null,
defaultOutName: null,
defaultVideoImageFormat: null,
defaultPixelFormat: null,
defaultProResProfile: null,
defaultSampleRate: null,
};
const {cancelSignal, cancel} = makeCancelSignal();
// Note that no `await` is used yet
const render = renderMedia({
composition,
codec: 'h264',
serveUrl: '/path/to/bundle',
outputLocation: 'out/render.mp4',
cancelSignal,
});
// Cancel render after 10 seconds
setTimeout(() => {
cancel();
}, 10000);
// If the render completed within 10 seconds, renderMedia() will resolve
await render;
// If the render did not complete, renderMedia() will reject
// ==> "[Error: renderMedia() got cancelled]"