2
0
telebot-reverser/reverser.js
2019-11-14 00:30:55 +01:00

23 lines
552 B
JavaScript

const path = require('path');
const ffmpeg = require('fluent-ffmpeg');
//const {path: ffPath} = require('@ffmpeg-installer/ffmpeg');
//ffmpeg.setFfmpegPath(ffPath);
const reverse = file => {
return new Promise((resolve, reject) => {
const basename = path.basename(file);
const savepath = path.join(__dirname, '../outputs', 're-' + basename);
ffmpeg(file)
.videoFilter('reverse')
.on('error', error => reject(error))
.on('end', async () => resolve({
path: savepath
}))
.save(savepath);
});
};
module.exports = {
reverse
};