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.

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?

share|improve this question

closed as off-topic by Moses, Kevin Panko, Shakehar, m4573r, tapped-out Jan 6 at 16:20

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they tend to become obsolete quickly. Instead, describe your situation and the specific problem you're trying to solve. Here are a few suggestions on how to properly ask this type of question." – Moses, Kevin Panko, Shakehar, m4573r, tapped-out
If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

1 Answer

up vote 8 down vote accepted

Video formats and general guidelines

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?

Let's use FFmpeg…

You should know how to install the latest version of FFmpeg. The latest versions always include up-to-date bugfixes and new functions. People often make the mistake to use the old versions bundled with their distributions or that they have on some server – these often just do not work.

Read the FFmpeg documentation, at least the general options, and learn the basic command line switches.

Also check out our Super User blog entry: FFmpeg: The ultimate Video and Audio Manipulation Tool for an always up-to-date guide on transcoding with FFmpeg and a few examples as well as a large link collection at the end.

Encoding with x264

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. Read the x264 encoding guide on the FFmpeg wiki. In short, this is what you can use:

  • -profile:v 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 compression, for example. These range from veryslow to ultrafast. Default is medium.
  • -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. Use a value between 18 and 27, where lower means better quality. Default is 23.

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.

share|improve this answer
add comment

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