Capítulo 135 de 988
Combine multiple video or audio chunks into a single output file. This function is useful for decentralized rendering workflows where different parts of a video are rendered separately and need to be combined.
// Video files rendered as separate chunks
const videoFiles = ['/path/to/chunk1.mp4', '/path/to/chunk2.mp4', '/path/to/chunk3.mp4'];
// Optional audio files corresponding to each video chunk
const audioFiles = ['/path/to/chunk1.aac', '/path/to/chunk2.aac', '/path/to/chunk3.aac'];
await combineChunks({
outputLocation: '/path/to/final-video.mp4',
videoFiles,
audioFiles,
codec: 'h264',
fps: 30,
framesPerChunk: 100,
audioCodec: 'aac',
preferLossless: false,
compositionDurationInFrames: 300,
});