Lately i've posted a lot of questions about how to use ffmpeg. It's pretty clear to me that I am missing some sort background in video encoding and was wondering if any of my fellow superusers had any good resources for studying up on video encoding. What do I need to understand before I can use ffmpeg effectively?

link|improve this question

40% accept rate
this may help a bit blog.superuser.com/2012/02/24/… – barlop Mar 19 at 19:54
feedback

1 Answer

up vote 4 down vote accepted

First of all, you need to understand which different codecs and formats exist, and what they are typically used for:

What is a Codec (e.g. DivX?), and how does it differ from a File Format (e.g. MPG)?

You should also look into what makes up video quality in a more general fashion, e.g. how does bit rate, frame rate, or picture size affect the quality?

What do the numbers 240 and 360 mean when downloading video? How can I tell which video is more compressed?


You should then know how to install the latest version of FFmpeg, preferably from the Git sources. There is an extensive tutorial for Ubuntu available. For Windows, there are builds online. For OS X, Homebrew has a formula.

Read the FFmpeg documentation and learn the basic command line options.

The best free video encoder out there today is x264, and using libx264, FFmpeg can use it too. You should install x264 and read the help with x264 --fullhelp. x264 has plenty of options, which are mapped to FFmpeg.

For encoding, you will then be able to use the presets x264 offers. They are accessible through the FFmpeg options too. There are some main options which come in handy:

  • -vprofile specifies the h.264 profile to be used, for example high, which could be used for all kinds of video playing software, or baseline, which restricts the video to use features that work on a mobile phone or iPod only.
  • -preset specifies the encoding presets for speed. fast will give you faster results, but worse quality, for example. These range from veryslow to ultrafast.
  • -tune offers options for tweaking the output based on the input files, e.g. animated movies with animation or normal movies with film.
  • -crf sets the Constant Rate Factor, the #1 method to be used when trying to tweak the result quality. Read up on it here.

You can install a video encoder like Handbrake and see which options it uses. Learn by doing, and try to read up on what all the parameters do.

enter image description here

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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