Search code examples
ffmpegflvaac

Convert audio-only flv to aac: ffmpeg


I can't convert a simple audio-only .flv to AAC format. The audio stream is obviously there, and I can hear it on manual playback. Are there different parameters I need to accomplish this?

ffmpeg -i test.flv test.aac
[flv @ 0x23b3260]Could not find codec parameters (Video: 0x0000)
Input #0, flv, from 'test.flv':
  Duration: 00:00:12.95, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: 0x0000, 1k tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: nellymoser, 8000 Hz, mono, s16
Output #0, adts, to 'test.aac':
    Stream #0.0: Audio: 0x0000, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
Unsupported codec for output stream #0.0

Solution

  • Try

    ffmpeg -i test.flv  -acodec libfaac  test.aac
    

    You can use the following to set bitrate, sample rate, and channels, respectively:

    -ab 128k -ar 48000 -ac 2
    

    Also, you may have to tell ffmpeg what steam you want to encode, by doing:

    ffmpeg -i test.flv -map 0:1 -acodec libfaac  test.aac 
    

    Which corespondes to

    Stream #0.1: Audio: nellymoser, 8000 Hz, mono, s16