Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

243
Views
No se puede guardar el búfer de la imagen en un archivo de video en el nodo js

Estoy tratando de capturar el búfer de imágenes de la aplicación del cliente al lado del servidor (nodejs) y guardarlo en la máquina local.

codigo del cliente -

 var imgStr = new Buffer(img).toString('base64'); var obj = {}; obj.image = imgStr; socket.emit("screen-capture", JSON.stringify(obj));

código del servidor (nodejs + express)-

 let chunks = [] socket.on("screen-capture", function (data) { data = JSON.parse(data); var imgStr = data.image; chunks.push(imgStr) let buffer = Buffer.from(chunks, 'base64'); console.log('is this a buffer?', buffer instanceof Buffer) // Giving True console.log("video size" + buffer.length) // Giving size fs.writeFile(`testing.mp4`, buffer, () => console.log('finished downloading video!')); // file saved })

Pero cuando se abre el archivo de video guardado, se muestra vacío.

cualquier ayuda es apreciada.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!