September 28, 2015

Recording & compressing short screencasts on Windows

Tools I use

My process

  1. Capture video using Camstudio

    I choose to record 1 window as my region, and compress with the Camstudio lossless codec.

  2. Use ffmpeg via a node.js script to batch convert videos

    This turns them into something that can be played in a web browser

    var fs = require("fs"),
      util = require("util"),
      child_process = require("child_process");
    
    var shellCommand =
      "c:\\ffmpeg\\bin\\ffmpeg.exe -i %s -codec:v libx264 -profile:v high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -threads 0 -y %s";
    
    fs.readdir("./", function (err, paths) {
      paths.forEach(function (path) {
        // TODO - only convert *.avi files
    
        var command = util.format(shellCommand, path, path.replace(".avi", ".mp4"));
    
        var child = child_process.exec(command, function (error, stdout, stderr) {
          console.log(path, err, stdout, stderr);
        });
      });
    });

    I base my settings on Jemej’s ffmpeg tutorial. The quality and framerate are low since I usually record things that don’t move much like terminal windows.

Ideas for improving