title: Node.js ffmetadata incorrect codec parameters
body: <p>I'm making a song downloader app in Node.js. I managed to get everything to work, the app downloads the song and downloads its artwork (image). So I have the mp3 file and jpg file. The only problem is attaching the jpg file to the mp3 file.</p>
  
  <p>I'm using the ffmetadata node.js module. I downloaded and installed its dependency "ffmpeg" cli.</p>
  
  <p>Now when I try to write the metadata to the mp3 file and attach the artwork it spits this error:</p>
  
  <pre><code>Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
  </code></pre>
  
  <p>My code:</p>
  
  <pre class="lang-js prettyprint-override"><code>ffmetadata.write('test.mp3', {}, {attachments: ['test.jpg']}, function(err) {
    if (err) console.error(err);
  });
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>[Error: ffmpeg version N-73872-g6b96c70 Copyright (c) 2000-2015 the FFmpeg developers
    built with gcc 4.9.2 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
    libavutil      54. 28.100 / 54. 28.100
    libavcodec     56. 50.101 / 56. 50.101
    libavformat    56. 40.101 / 56. 40.101
    libavdevice    56.  4.100 / 56.  4.100
    libavfilter     5. 25.100 /  5. 25.100
    libswscale      3.  1.101 /  3.  1.101
    libswresample   1.  2.101 /  1.  2.101
    libpostproc    53.  3.100 / 53.  3.100
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'songs/Irresistible - Fall Out Boy (Lyrics).mp3':
    Metadata:
      major_brand     : dash
      minor_version   : 0
      compatible_brands: iso6mp41
      creation_time   : 2015-04-03 10:45:25
    Duration: 00:03:26.94, start: 0.000000, bitrate: 128 kb/s
      Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
      Metadata:
        creation_time   : 2015-04-03 10:45:25
        handler_name    : SoundHandler
  Input #1, image2, from 'songs/albumart/Irresistible - Fall Out Boy (Lyrics).jpg':
    Duration: 00:00:00.04, start: 0.000000, bitrate: 24578 kb/s
      Stream #1:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 640x640 [SAR 300:300 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
  [mp3 @ 0000000004865d80] Invalid audio stream. Exactly one MP3 audio stream is required.
  Output #0, mp3, to 'songs\Irresistible - Fall Out Boy (Lyrics).ffmetadata.mp3':
    Metadata:
      major_brand     : dash
      minor_version   : 0
      compatible_brands: iso6mp41
      dryRun          : true
      encoder         : Lavf56.40.101
      Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 125 kb/s (default)
      Metadata:
        creation_time   : 2015-04-03 10:45:25
        handler_name    : SoundHandler
      Stream #0:1: Video: mjpeg, yuvj444p, 640x640 [SAR 300:300 DAR 1:1], q=2-31, 25 tbr, 25 tbn, 25 tbc
  Stream mapping:
    Stream #0:0 -&gt; #0:0 (copy)
    Stream #1:0 -&gt; #0:1 (copy)
  Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
  ]
  </code></pre>