Skip to content

Instantly share code, notes, and snippets.

View timgreen's full-sized avatar

Tim Green timgreen

  • Sydney, Australia
View GitHub Profile
@timgreen
timgreen / trace-to-mp4.js
Last active October 16, 2018 10:51 — forked from krisselden/trace-to-mp4.js
Make an mp4 out of a Chrome DevTools trace with screenshots.
#!/usr/bin/env node
// Converts a saved Chrome dev tools recording with Screenshots to mp4
const fs = require('fs');
const path = require('path');
const spawn = require('child_process').spawn;
const FPS = 60;
const MICROSEC_PER_FRAME = Math.round(1000000 / FPS);
if (process.argv.length < 3) {
console.log(`node ${path.relative('.', process.argv[1])} [DevToolsProfile]`);
process.exit(1);