Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

videotomp3 conversion issue #1263

Open
Prameelagolusula opened this issue Apr 11, 2024 · 2 comments
Open

videotomp3 conversion issue #1263

Prameelagolusula opened this issue Apr 11, 2024 · 2 comments

Comments

@Prameelagolusula
Copy link

(function(){
console.log("node");
var ffmpeg = require('fluent-ffmpeg');

var args = process.argv.slice(2);

function baseName(str) {
var base = str.substring(str.lastIndexOf('/') + 1);
if (base.lastIndexOf(".") !== -1) {
base = base.substring(0, base.lastIndexOf("."));
}
return base;
}

args.forEach(function(val, index, array) {
var filename = val;
console.log(filename);
var basename = baseName(filename);
console.log(basename);

  ffmpeg(filename)
      .toFormat('mp3')
      .saveToFile(basename + '.mp3')
      .on('error', (err) => {
          console.log(err);
      })
      .on('progress', (progress) => {
          console.log("...frames: " + progress.frames);
      })
      .on('end', () => {
          console.log("Finished processing");
      })
      .run();

});
})();

@Prameelagolusula
Copy link
Author

C:\Users\samit\Desktop\videotomp3>node index.js video.mp4
node
video.mp4
video
Error: Output format mp3 is not available
at C:\Users\samit\Desktop\videotomp3\node_modules\fluent-ffmpeg\lib\capabilities.js:589:21
at fn (C:\Users\samit\Desktop\videotomp3\node_modules\async\lib\async.js:582:34)
at Immediate._onImmediate (C:\Users\samit\Desktop\videotomp3\node_modules\async\lib\async.js:498:34)
at process.processImmediate (node:internal/timers:478:21)
Error: Output format mp3 is not available
at C:\Users\samit\Desktop\videotomp3\node_modules\fluent-ffmpeg\lib\capabilities.js:589:21
at fn (C:\Users\samit\Desktop\videotomp3\node_modules\async\lib\async.js:582:34)
at Immediate._onImmediate (C:\Users\samit\Desktop\videotomp3\node_modules\async\lib\async.js:498:34)
at process.processImmediate (node:internal/timers:478:21) this the error im getting

@MarianoFacundoArch
Copy link

#1266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants