1

I really don't know it is a dumb question or not but can I really combine multiple video files (same resolution) into one using Buffer.concat

this is my try but the final video only plays the first part of the video which is 1.webm and the video ends

const fs = require('fs');

const data1 = fs.readFileSync('1.webm');
const data2 = fs.readFileSync('2.webm');
const data3 = fs.readFileSync('3.webm');
const data4 = fs.readFileSync('4.webm');
const data5 = fs.readFileSync('6.webm');
const data6 = fs.readFileSync('7.webm');
const data7 = fs.readFileSync('8.webm');

const combine = Buffer.concat([data1, data2, data3, data4, data5, data6, data7])

console.log(combine);

fs.writeFile('final.mp4', combine, (err) =>{
    console.log('I am Err', err)
})
Nane
  • 2,370
  • 6
  • 34
  • 74

0 Answers0