TheDeanVanGreunen

convert from webm to mp4

Sep 10th, 2020
849
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function convert(input, output, callback) {
  3.   if (debug) {
  4.     console.log("CONVERTING");
  5.     console.log("IN: " + input);
  6.     console.log("OUT: " + output);
  7.   }
  8.   ffmpeg(input)
  9.     .outputOptions([
  10.       "-i clipdrop_logo.png",  // Logo WaterMark Input
  11.       "-loglevel panic",
  12.       "-preset veryfast",
  13.       "-movflags faststart",
  14.       "-vf scale=-1:480",
  15.       "-c:v libx264",
  16.       "-crf 23",
  17.       "-c:a aac",
  18.       "-bitrate 2000000",
  19.       "-maxrate 2200000",
  20.       "-bufsize 1500000",
  21.       "-filter_complex \"overlay=main_w-overlay_w-5:main_h-overlay_h-5\""  // Logo WaterMark Settings
  22.     ])
  23.     .on("end", function () {
  24.       if (debug) {
  25.         console.log("conversion ended");
  26.       }
  27.       callback(null);
  28.     })
  29.     .on("error", function (err) {
  30.       if (debug) {
  31.         console.log("error x: ", err);
  32.       }
  33.       callback(err);
  34.     })
  35.     .saveToFile(output);
  36. }
RAW Paste Data