series.push(function(callback){
     grunt.log.debug('ffmpeg ' + flags.join(' '));
     ffmpeg.exec(flags, function() {
         grunt.verbose.ok('Responsive Video: ' + srcPath + ' now ' + outPath);
         return callback();
     });
 });
示例#2
0
 fixFile(fileStats.name, function (file, artist, album, title) {
     ffmpeg.exec(["-i", file, "-acodec",
         "copy", "-metadata", "title=" + title, "album=" + album, "artist=" + artist, 
         "/home/pi/musics/" + file.substr(0, file.length - 3) + "mp3"], function () {
             console.log('ok');
         });
 });
 this._onMetadata = function(info) {
     if (info.title == undefined) {
         Log.prototype.log(self.classDescription, "Injecting Metadata into: " + self.queueProcessor.currentItem.filename);
         fs.renameSync(self.config.mediaDirectory + "/" + self.queueProcessor.currentItem.filename, self.config.mediaDirectory + "/temp" + self.queueProcessor.currentItem.filename)
         ffmpeg.exec(["-i", self.config.mediaDirectory + "/temp" + self.queueProcessor.currentItem.filename, "-y", "-acodec", "copy", "-metadata", "title=" + self.queueProcessor.currentItem.label, self.config.mediaDirectory + "/" + self.queueProcessor.currentItem.filename], self._onProcessAssetComplete);
     }  else {
         self._onProcessAssetComplete();
     }
 }
                    series.push(function(callback){
                        var flags = [];
                        var posterConfigType = typeof size.poster;
                        var seektime;

                        // accurateseek object contains an 'accurateseek' property
                        if (posterConfigType === 'object' && typeof size.poster.accurateseek === 'string') {

                            // -ss param after input
                            flags.push('-i', srcPath);
                            flags.push('-ss', size.poster.accurateseek);

                        // string is assumed to be format '00:02:00' and will fast seek.
                        // if object with fastseek propery, same settings
                        } else if (posterConfigType === 'string' || (posterConfigType === 'object' && typeof size.poster.fastseek === 'string')) {
                            seektime = (posterConfigType === 'string') ? size.poster : size.poster.fastseek;

                            // -ss param before input
                            flags.push('-ss', seektime);
                            flags.push('-i', srcPath);

                         // boolean true or something configured wrong.
                         // just grab the first frame. warn if misconfigured.
                        } else {
                            if (posterConfigType !== 'boolean') {
                                grunt.log.writeln('Poster option invalid. Using first frame.');
                            }
                            flags.push('-i', srcPath);
                        }

                        flags.push('-vframes', '1'); //grab only one frame
                        flags.push('-vf', getFilterGraphFlags(size));
                        flags.push(posterPath);
                        grunt.log.debug('ffmpeg ' + flags.join(' '));
                        ffmpeg.exec(flags, function() {
                            grunt.verbose.ok('Responsive Video: ' + srcPath + ' now ' + posterPath);
                            return callback();
                        });
                    });