ffmpeg convert avi to flv or mpeg issues [solved]

http://www.rodrigopolo.com/ffmpeg/cheats.html < awesome

Had some issues converting an .avi into a .flv file to embed in a website using the flash flowplayer.

  1. First I tried this:
    ffmpeg -i input.avi output.flv

    and got this error:

    Input #0, avi, from 'input.avi':
      Duration: 00:00:27.8, start: 0.000000, bitrate: 4128 kb/s
        Stream #0.0: Video: mjpeg, yuvj422p, 640x480 [PAR 0:1 DAR 0:1], 15.00 tb(r)
        Stream #0.1: Audio: pcm_s16le, 7875 Hz, mono, 126 kb/s
    Output #0, flv, to 'output.flv':
        Stream #0.0: Video: flv, yuv420p, 640x480 [PAR 0:1 DAR 0:1], q=2-31, 200 kb/s, 15.00 tb(c)
        Stream #0.1: Audio: adpcm_swf, 7875 Hz, mono, 64 kb/s
    Stream mapping:
      Stream #0.0 -> #0.0
      Stream #0.1 -> #0.1
    [adpcm_swf @ 0x7f0f3be6ba00]Sample rate must be 11025, 22050 or 44100
    Error while opening codec for output stream #0.1 - maybe incorrect parameters such
    as bit_rate, rate, width or height
  2. Then I tried this:

    ffmpeg -i input.avi -vcodec copy -acodec pcm_s16le output.flv

    and got this error:

    [pcm_s16le @ 0x7f058dfcba00]flv does not support that sample rate, choose from (44100, 22050, 11025).
    Could not write header for output file #0 (incorrect codec parameters ?)
  3. Then i tried this

    ffmpeg -i input.avi -vcodec copy -acodec pcm_s16le -ar 44100 output.flv

    and only got audio, no video in output file.

  4. Then this:

    ffmpeg -i input.avi -ar 44100 output.flv

    and finally got something that works, however the quality wasn’t great.

  5. To increase quality, use the -sameq argument (same quality as source) This doubled the file size but the flv was much higher quality.

    ffmpeg -i input.avi -sameq -ar 44100 output.flv

Leave a Reply

Your email address will not be published.