How did you learn that? I didn't find a book about this topic on Amazon.
Ugh, I don't know how to answer that question. I personally learned it in a very long process. I am currently doing my PhD in theoretical physics. Linux computers and algorithms in general are my daily bread and have been for at least 8 years. And in Linux, ffmpeg is all we have.
I don't know if there is a good book or video out there about ffmpeg and how you can tweak it. For compression algorithms, a nice and easy way to start would be this
video on codecs and how they work. And for ffmpeg, I basically read the manpage (you do know "man ffmpeg", right?).
Special things like the number of pixels should be dividable by 8 in each direction I learned along the way... The first few important things are:
1. Choose h264 as video codec.
2. Choose something like mp3 as an audio codec with about 192 kBit/s.
3. Definitely do a two-pass encoding.
Most of the rest is very dependent on your video file. By now, I mainly use ffmpeg to change containers, cherry pick audio tracks or do a quick batch-convert. I can tell you without even looking at the manpage that the command line for the second pass of said 3 points would be something like
Code:
ffmpeg -i Infile.mov -map 0:0 -map 0:1 -acodec mp3 -ab 192k -vcodec h264 -b 2000k -pass 2 -aspect 16:9 -s 1280x720 Outfile.mov
Now, I really did not check any of these options, but I'm pretty sure they work and I know them by heart now. Yet still, I bought Compressor (40 euros...) and only use ffmpeg to change a container or cherry pick an audio track by now. I do all my conversions in Compressor. I honestly suggest you do, too! It will save you so much time.
----------
Compressor 4 and HandBrake are very close....
Handbrake is a very niftly little tool. It allows for many manual settings and is way easier to work with than ffmpeg on the command line.
However, Handbrake encodes with nothing else than ffmpeg too. It is just a frontend for this awesome tool, and the original will provide you with even more optional arguments.
Still, Handbrake is worth a look as a kind of "in between" solution if you don't want to spend the money on Compressor but want a more manageble GUI for your encoding. And the options you get there will leave you with decent results for sure, if you learn how to handle them.