Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

websites that help convert html5 animations to video

Recommended Posts


I would like to convert HTML5 animations to video.

we have ccapture.js for converting canvas animations to video but it is a real headache to convert html5 animations to video. Yes, I did the research for the past two days on this single topic and I read all the threads in this forum but nothing helped much. 

(Here are some of the posts I read here: )








I have found few online services like




all these are working great but when I contact for API solution. there is no reply from them. do you know any service like above and is active?

or it would be even better if someone could help me get this working (I'm even willing to pay to someone who can help me set this up)...I saw @swampthang has been working on similar issue...hope maybe he (or anyone) can help.


The end result should be a video not a gif. I saw solutions to extract frame by frame to PNG/JPEG and then converting to gif/video but it is not providing good results and takes too much time for videos more than 2 mins.




Link to post
Share on other sites

@namisuki, some questions for you:

Are you attempting to do this on a web server?

Are you using or can you use node.js?

If you are or can use node.js, can you install any node module on your server?


I am using node.js in Electron and am using ffmpeg (using the node module fluent-ffmpeg) to build out videos. ffmpeg is lightening fast but you have to create a png sequence to hand it as an input.

I have everything in a master SVG. You can add images using the <image/> element in an embedded SVG and text can be added in a foreignObject. I can point you in the right direction for this if you need help. As for creating an image sequence, here's an example of how to create the sequence from a GSAP timeline (older so not 3.0)


See the Pen yaYJpm by swampthang (@swampthang) on CodePen


With each iteration of the loop I use the node module base64-img to save each sequence as a transparent png in sequence like this:


const base64Img = require('base64-img');

function processTimeline(obj) {

  let current = 0,
      FPS = 30,
      saveDir = 'your/save-to/path/',
      masterTL = yourMasterTimeline,
      masterSVG = document.getElementById("stage-master"), // this is the id of the master SVG
      duration = masterTL.duration(),
      frames   = Math.ceil(duration / 1 * FPS);


  masterTL.progress(0); // set the progress of the masterTL to 0

  // advance by 1 frame
  masterTL.progress(current++ / frames);


  function makePNG() {

    if( current == frames ) {
      masterTL.progress(1); // make sure the timeline is all the way to the end

    let xml  = new XMLSerializer().serializeToString(masterSVG);
    // get the base64 string
    thisImgData = buildSvgImageUrl(xml);
    // set the new filename
    let padded = pad(current,5);
    let filename = `img${padded}`;
    let thisFilePath = saveDir+filename+'.png';

    function loadImage() {

      // now create the png file and save it to the save-to folder
      let canvas = document.createElement("canvas");
      canvas.width = WD;
      canvas.height = HT;

      let ctx = canvas.getContext("2d");

      let img  = new Image();
      img.crossOrigin = "Anonymous";

      img.onload = function() {
        ctx.drawImage(img, 0, 0, WD, HT);
        let url = canvas.toDataURL("image/png");
        // I'm using a node module by the name of base64-img (see entry at top)
        let fullPath = base64Img.imgSync(url, saveDir, filename);


      img.src = thisImgData;

      img.onerror = function(error) {

    function checkCurrentFrame() {
      if( current == frames ) {

        createAnimationVideo(obj); // whatever your video creation script is

      } else {
        // advance the current frame
        masterTL.progress(current++ / frames);

function buildSvgImageUrl(svg) {
  let b64 = window.btoa(unescape(encodeURIComponent(svg)));
  return "data:image/svg+xml;base64," + b64;

function pad(str, max) {
  str = str.toString();
  return str.length < max ? pad("0" + str, max) : str;

Adding the png sequence as a single input is as easy as:


proc = new ffmpeg();

    .addInputOption('-thread_queue_size 512')
    .addInputOption(`-r ${obj.FPS}`)
    .addInputOption(`-f image2`);

You can look at the fluent-ffmpeg docs to see how to set up the ffmpeg process listeners like proc.on('start', function()). There's an on 'start', 'progress', 'error', and 'end'. Hope that helps. FFMPEG is an executable so it's not subject to the single thread limitation of javascript. fluent-ffmpeg is a node module that allows you to make calls to the executable from within a javascript thread.


  • Like 2
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.