Advertisement
Rawoas13

Convert from webm to mp4:x

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