3

I'm using the fluent-ffmpeg module for Node.js to convert audio files. I have a .mp3 file that I'd like to convert to .wma

Here's what that looks like:

var proc = new ffmpeg({
   source: 'file.mp3',
   nolog: false
}).toFormat('wma')                                                
  .saveToFile('file.wma', function(stdout, stderr)
{                                                 
    console.log(stderr);
});

Unfortunately, I get the error:

Requested output format 'wma' is not a suitable output format

This is the entire error log:

ffmpeg version 0.8.9-4:0.8.9-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
  built on Nov  9 2013 19:25:10 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, mp3, from 'song_downloads/You Suffer.mp3':
  Metadata:
    title           : You Suffer
    artist          : Napalm Death
    album           : Scum
    genre           : Death Metal
    track           : 12
    date            : 1987
  Duration: 00:00:04.98, start: 0.000000, bitrate: 381 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 193 kb/s
Requested output format 'wma' is not a suitable output format

I know this isn't an ffmpeg issue because

ffmpeg -i file.mp3 file.wma

Works fine. Any ideas?

Jack Guy
  • 8,346
  • 8
  • 55
  • 86

2 Answers2

4

I think, wma is not a container format. It is an audio codec. WMA file is most commonly contained in ASF (Advanced Systems Format) format. So choose the correct options as given in the fluent-ffmpeg API to set codec and the format. You can run these commands:

  1. ffmpeg -formats to see all formats and

  2. ffmpeg -codecs to see all supported codecs

user568109
  • 47,225
  • 17
  • 99
  • 123
  • 1
    That doesn't explain why it converts successfully in the command line. – Jack Guy Dec 23 '13 at 05:58
  • 3
    @J4g The command line sets appropriate options based on the user input(like setting codec and format for commonly known files). My guess is that fluent API maps to verbose options (starting with -vcodec -acodec). So the auto setting of options which happens from command line does not happen via fluent-ffmpeg. – user568109 Dec 23 '13 at 06:07
-1

this worked for me fine

fluent_ffmpeg('input.mp3').audioCodec("aac").save('output.aac')

when formats was: D aac raw ADTS AAC (Advanced Audio Coding)

not E = Muxing supported