BlueImp also supports MOV files

pull/9/head
rprieto 10 years ago
parent ddcf0c48aa
commit 2ddaa83728

@ -29,7 +29,7 @@ exports.fromDisk = function(mediaPath, mediaPrefix) {
}
}
function isVideo(file) {
return file.match(/mp4$/) != null;
return file.match(/\.(mp4|mov)$/) != null;
}
function byFolder(file) {
@ -37,7 +37,7 @@ exports.fromDisk = function(mediaPath, mediaPrefix) {
}
function byExtension(file) {
return file.match(/\.(jpg|jpeg|png|mp4)$/)
return file.match(/\.(jpg|jpeg|png|mp4|mov)$/)
}
function folderInfo(files, name) {

@ -32,15 +32,17 @@ exports.build = function(opts) {
gulp.task('thumbs-videos', function() {
var files = wrench.readdirSyncRecursive(opts.input);
var videos = files.filter(function(f) { return f.match(/\.mp4$/); });
var videos = files.filter(function(f) {
return f.match(/\.(mp4|mov)$/);
});
videos.forEach(function(videoPath) {
var input = path.join(opts.input, videoPath);
var thumb = path.join(opts.output, 'thumbs', videoPath.replace('.mp4', '.jpg'));
var poster = path.join(opts.output, 'thumbs', videoPath.replace('.mp4', '_poster.jpg'));
var thumb = path.join(opts.output, 'thumbs', videoPath.replace(/\.[a-z0-9]+$/, '.jpg'));
var poster = path.join(opts.output, 'thumbs', videoPath.replace(/\.[a-z0-9]+$/, '_poster.jpg'));
var ffmpeg = 'ffmpeg -itsoffset -1 -i ' + input + ' -ss 0.1 -vframes 1 -y ' + poster;
var ffmpeg = 'ffmpeg -itsoffset -1 -i "' + input + '" -ss 0.1 -vframes 1 -y "' + poster + '"';
var exec = require('child_process').exec
exec(ffmpeg, function(err, stdout, stderr) {

Loading…
Cancel
Save