How to use the fluent-ffmpeg.Metadata function in fluent-ffmpeg

To help you get started, we’ve selected a few fluent-ffmpeg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sahat / cloudbucket / server.js View on Github external
if (err) {
                  console.error(err);
                  req.flash('info', 'Unable to save to database (EPUB)');
                  return res.redirect('/upload');
                }
                callback(null);
              });
            });

          });
          break;
        case 'avi':
        case 'mp4':
        case 'mov':
        case 'flv':
          var metaObject = new Metalib(filePath, function(metadata, err) {
            console.log(metadata);
            //var meta = util.inspect(metadata, false, null);
            file.videoCodec = metadata.video.codec;
            file.videoBitrate = metadata.video.bitrate;
            file.videoResolution = metadata.video.resolution;
            file.videoFps = metadata.video.fps;
            file.videoAudioCodec = metadata.audio.codec;
            file.videoAudioBitrate = metadata.audio.bitrate;
            file.videoAudioSampleRate = metadata.audio.sample_rate;

            // Save to database
            file.save(function(err) {
              if (err) {
                console.error(err);
                req.flash('info', 'Unable to save to database (VIDEO)');
                return res.redirect('/upload');