Saturday, October 26, 2013

Convert M4V to AVI Using ffmpeg

I tried numerous ffmpeg settings to convert some M4V (MP4) files into AVI. Most either didn't work or crashed with a segmentation fault.

The only one I found that worked was this answer at StackOverflow. However, the quality of the file produced using the settings in the answer wasn't great, so this is what I ended up using:

ffmpeg -i input.m4v -f avi -b 2048k -ab 160k -ar 44100 output.avi

The output files are about twice the size of the input file, unfortunately, but they look decent.

3 comments:

  1. Hi Ash, I believe you should be able to do this without the re-encoding. See http://forum.doom9.org/archive/index.php/t-124877.html for example.

    I was just able to successfully test this with a 1GB mkv file to avi file very quickly.

    ReplyDelete
    Replies
    1. Thanks Dave,

      I tried out the command in the link. Something strange happened: it took ages, the resulting file was >13GB (!), and then VLC couldn't play it. mediainfo reported that it was an AVI container, but the file wasn't in a happy place.

      This was the command:
      ffmpeg -i input.m4v -vcodec copy -acodec copy output.avi

      Delete
    2. This codec copy worked for me, thanks!

      Delete