Created
December 21, 2015 15:44
-
-
Save ryush00/4f648ccfc8260ddf7503 to your computer and use it in GitHub Desktop.
동일 폴더의 모든 동영상의 썸네일 사진 만들기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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