Export frames from video
This was the first script of many I wrote for An over-analytical analysis of style. To be honest, it’s probably not a super useful script for anyone other than myself. Nonetheless, it’s a quick boilerplate for anyone who wants to quickly being exporting frames from a video. This script can take some time to grind through large videos, so just be prepared.
Instructions
- Copy the code below into a file on your machine. Let’s name it
export-video-frames.js - Install Node.js
- Fire up a Terminal window and
cdto the directory where you saved theexport-video-frames.jsfile - This script requires node-ffmpeg. To install,
cdinto your project’s directory and runnpm i ffmpeg --save-devin your terminal. I try to avoid using third-party libraries, but I ended up taking a shortcut for this project. - Edit
VIDEO_PATH,EXPORT_PATH,EXPORT_FILENAME,FRAME_RATE, andIMAGE_DIMENSIONSto fit your needs - Run
node export-video-frames.jsin your terminal - Read out the results returned in the terminal