项目作者: justinribeiro

项目描述 :
Output a video file from screenshot frames within a Chrome DevTools JSON trace file.
高级语言: JavaScript
项目地址: git://github.com/justinribeiro/devtools-to-video.git
创建时间: 2019-10-16T00:25:29Z
项目社区:https://github.com/justinribeiro/devtools-to-video

开源协议:MIT License

下载


npm version

devtools-to-video

Output a video file from screenshot frames within a Chrome DevTools JSON trace file.

image

Example video output from tool: justinribeiro.com @ 3G Slow, Moto G4

Install

  1. npm i @justinribeiro/devtools-to-video
  2. # or
  3. yarn global add @justinribeiro/devtools-to-video

After install, run the command with -h to see usage information:

  1. devtools-to-video -h
  2. DEVTOOLS-TO-VIDEO
  3. Output a video file from screenshot frames within a Chrome DevTools JSON trace file.
  4. Usage: `devtools-to-video [options ...]`
  5. Global Options
  6. -i, --input string File path to Chrome DevTools trace JSON file.
  7. -o, --output string Output file name for video file.
  8. -c, --hideClock If set, hides the time scale clock on the output video file.
  9. -l, --label string If set, adds the label above the time scale clock in the output video file.
  10. -f, --frames number Sets the frames per second of the output video.
  11. -h, --help Print out helpful usage information for this program.
  12. -v, --version Print out current program version number.
  13. Version
  14. 0.1.0

Sample command

  1. devtools-to-video -i Profile-20191015T174036.json -o sample5.mp4 -l '3G Slow @ Moto G4'
  2. STARTING UP Checking environment and setting up params.
  3. CONVERT Spawning FFMPEG worker with open pipe.
  4. CONVERT Begin piping screenshots from DevTools trace to FFMPEG.
  5. SCREENSHOTS Processed 24 screenshots into video file.
  6. CONVERT DevTools trace successfully converted to MP4.
  7. LABEL PASS Adding label and time scale to MP4.
  8. LABEL PASS Finished adding label and time scale to MP4.
  9. COMPLETE DevTools trace to video is now complete! You file sample5.mp4 is ready

Credit where credit is due

  1. WebPageTest does this way cooler.
  2. Kris Selden’s trace-to-mp4.js gist (mad props)
  3. FFMPEG…we’re had some adventures haven’t we?