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
cd
to the directory where you saved theexport-video-frames.js
file - This script requires node-ffmpeg. To install,
cd
into your project’s directory and runnpm i ffmpeg --save-dev
in 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_DIMENSIONS
to fit your needs - Run
node export-video-frames.js
in your terminal - Read out the results returned in the terminal