Skip to content

Instantly share code, notes, and snippets.

@ryush00
Created December 21, 2015 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryush00/4f648ccfc8260ddf7503 to your computer and use it in GitHub Desktop.
Save ryush00/4f648ccfc8260ddf7503 to your computer and use it in GitHub Desktop.
동일 폴더의 모든 동영상의 썸네일 사진 만들기
var ffmpeg = require('fluent-ffmpeg');
var fs = require('fs');
var files = fs.readdirSync(__dirname);
var path = require('path');
for(var i in files) {
if(path.extname(files[i]) === ".mp4") {
ffmpeg(files[i])
.screenshots({
timestamps: ['50%'],
filename: ''+files[i]+'.thumb.png',
folder: __dirname,
size: '1280x720'
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment