This simple one-liner will encode a video to a format suitable for Youtube.
4.4 Tue Sep 04 jason@Yog-Sothoth 0: $ ffmpeg -i scorcher.avi -codec:v libx264 -crf 21 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart scorcher.mp4
This gives good quality output whilst reducing the file-size by 10. This is the best way. Uploading a 4 GiB file to Youtube takes too long, this will really help out.
This example directory listing shows the reduction in file-size.
4.4 Tue Sep 04 jason@Yog-Sothoth 0: $ ls -hula aa* -rwxrwxrwx 1 jason jason 404M Sep 3 08:33 aa.avi -rwxrwxrwx 1 jason jason 29M Aug 26 14:29 aa.mp4
Another example.
4.4 Tue Sep 04 jason@Yog-Sothoth 0: $ ls -hula yantar* -rwxrwxrwx 1 jason jason 2.7G Jun 6 10:37 yantar-controller.avi -rwxrwxrwx 1 jason jason 168M Jun 10 14:18 yantar_controller.mp4 -rwxrwxrwx 2 jason jason 5.2G Jun 4 19:57 yantar_emitter.avi -rwxrwxrwx 1 jason jason 456M Sep 4 08:00 yantar_horror.mp4