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

220
Views
Is it possible to convert an array of image data URLs, obtained via toDataURL, into an MP4 using javascript and console commands?

Im trying to record a 5 second video of the browser and then save them as an mp4 file.

So far I am capturing the browser as an image alright, and then I can use ffmpeg on my machine locally to create a video using the downloaded pngs BUT I want to generate this video using the array of image urls I will have generated without the user having to download all the images first.

Here is what I have so far to test how I obtain the images:

let myImages = []
let imageCount = 120

window.runGrab = function(){ 
    html2canvas(document.body, {
        useCORS: true,
    }).then(function (canvas) {
        for(let i = 0; i <= imageCount; i++){
            setTimeout(function(){
                myImages.push(canvas.toDataURL("image/png"))

                if(i === imageCount){
                    let a = document.createElement("a");

                    a.href = myImages[0];
                    a.download = 'img000.png';
                    a.click();
                }
            }, 24)
        };
    })
}

And here is the command line I'm using manually to test the video creation:

ffmpeg -loop 1 -i img%03d.png -c:v libx264 -t 5 -pix_fmt yuv420p -vf scale=320:240 out.mp4

How can I pass the image urls instead of 'img%03d.png'?

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!