Posted: . At: 9:28 AM. This was 6 years ago. Post ID: 12410
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



How to best encode a video for Youtube on Linux.


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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.