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

153
Views
Creating video from images using ffmpeg-stream

I'm trying to create a video file using multiple images using ffmpeg-stream.

Here's my code,

const { Converter } = require("ffmpeg-stream")

const frames = ["open.jpg", "close.jpg", "open.jpg", "close.jpg"]

// create converter
const converter = new Converter()

// create input writable stream (the jpeg frames)
const converterInput = converter.createInputStream({ f: "image2pipe", r: 30 })

// create output to file (mp4 video)
converter.createOutputToFile("out.mp4", {
  vcodec: "libx264",
  pix_fmt: "yuv420p",
})

// start the converter, save the promise for later
const convertingFinished = converter.run()

// pipe all the frames to the converter sequentially
for (const filename of frames) {
  // create a promise for every frame and await it
   new Promise((resolve, reject) => {
    fs.createReadStream(filename)
      .pipe(converterInput, { end: false }) // pipe to converter, but don't end the input yet
      .on("end", resolve) // resolve the promise after the frame finishes
      .on("error", reject)
  })
}
converterInput.end()

Code in the ffmpeg-stream docs, https://github.com/phaux/node-ffmpeg-stream#how-to-create-an-animation-from-a-set-of-image-files

They are using s3, I just changed it to my local file in my code. Everything else is almost same. But when I run it I get the following error,

node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

Error: spawn ffmpeg ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn ffmpeg',
  path: 'ffmpeg',
  spawnargs: [
    '-f',       'image2pipe',
    '-r',       '30',
    '-i',       'pipe:3',
    '-vcodec',  'libx264',
    '-pix_fmt', 'yuv420p',
    'out.mp4'
  ]
}

What am I doing wrong :(

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!