From 867dda551d24e1b34f108020cf1282d8db2ed212 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 12 Oct 2019 13:09:19 +0200 Subject: [PATCH] change the level of compression --- commands/fun/vidshittifyer.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/commands/fun/vidshittifyer.js b/commands/fun/vidshittifyer.js index 2a18e34..a479089 100644 --- a/commands/fun/vidshittifyer.js +++ b/commands/fun/vidshittifyer.js @@ -18,6 +18,12 @@ class vidshittifyerCommand extends Command { { id: 'compresion', type: 'string' + }, + { + id: 'watermark', + match: 'flag', + flag: '--watermark' + } ], description: { @@ -32,11 +38,13 @@ class vidshittifyerCommand extends Command { let input = `${os.tmpdir()}/${message.id}.mp4`; let output = `${os.tmpdir()}/Shittifyed${message.id}.mp4`; let compression; + let option = `-b:v ${compression} -b:a ${compression}`; + if (args.link) { if (args.compression == 1) { - compression = '1m'; + compression = '10m'; } else if (args.compression == 2) { - compression = '50k'; + compression = '5m'; } else { compression = '10k'; } @@ -47,7 +55,7 @@ class vidshittifyerCommand extends Command { }); video.pipe(fs.createWriteStream(input)); video.on('end', function () { - exec(`ffmpeg -i ${input} -b:v ${compression} -b:a ${compression} -vcodec libx264 -r 5 -r 15 ${output}`) + exec(`ffmpeg -i ${input} ${option} -vcodec libx264 -r 5 -r 15 ${output}`) .then(() => { message.delete(); return message.channel.send({files: [output]})