Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm on MacOSX Lion and would like a method for converting webm to mp4 (or another iTunes compatible format). ffmpeg seems like a possibility but the documentation is a bit obtuse for me; step-by-step directions would be appreciated.

share|improve this question

1 Answer 1

Get FFmpeg

If you want to use ffmpeg, go and either

  • download a recent version of it, or
  • install it through Homebrew with

    brew install ffmpeg --devel --with-fdk-aac
    

    The devel switch tells it to install the 2.x version, not the 1.x one. libfdk-aac is a great AAC encoder.

If you downloaded it manually (not with Homebrew), I would suggest copying the ffmpeg executable file to your PATH, so that you can use it from the Terminal. Let's say you downloaded it to ~/Downloads/ffmpeg/ffmpeg, then do:

sudo mkdir -p /usr/local/bin
sudo cp ~/Downloads/ffmpeg/ffmpeg /usr/local/bin/
sudo chmod +x !$ /usr/local/bin/ffmpeg

Convert to MP4

Now, by "to MP4", I assume you mean to use H.264 and AAC as video and audio codecs, respectively. For that, the basic command would be:

ffmpeg -i input.webm -c:v libx264 -c:a aac -strict experimental -b:a 192k output.mp4

If you want to control the quality, have a look at the x264 encoding guide. It is set with the -crf option, where the default is 23, and lower means better quality (typical values are from 18 to 28). In the above example it uses the default quality of 23 for video, and 192 kBit/s constant bitrate for audio.

As for audio, the static builds do not support libfdk-aac, but if you installed it through Homebrew, you should use that instead:

ffmpeg -i input.webm -c:v libx264 -c:a libfdk-aac output.mp4

FDK-AAC gives you better quality than the internal AAC encoder. For controlling audio quality, see the AAC encoding guide.

share|improve this answer

protected by slhck Apr 21 at 7:06

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.