Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ffmpeg from 'fluent-ffmpeg';
- import { settings } from '../../../../system';
- export default (incomingPatchFile, outgoingPatchFile) => {
- const ffmpegPath = settings.get('system.ffmpeg.path', '');
- ffmpeg.setFfmpegPath(ffmpegPath);
- return new Promise((resolve, reject) => {
- const command = ffmpeg(incomingPatchFile)
- .audioBitrate('32k')
- .audioChannels(1)
- .audioCodec('libmp3lame')
- .audioFrequency(22050)
- .audioQuality(4)
- .format('mp3')
- .noVideo();
- command.on('error', (error) => reject(error));
- // command.on('start', (commandLine) => {
- // logger.debug('Успешно инициализирован ffmpeg', { commandLine });
- // });
- command.on('end', () => resolve());
- command.output(outgoingPatchFile).run();
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement