Skip to content

Instantly share code, notes, and snippets.

@AkBKukU
Created December 21, 2018 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkBKukU/11ec6b912078b9c3a3b2b578d4cefde2 to your computer and use it in GitHub Desktop.
Save AkBKukU/11ec6b912078b9c3a3b2b578d4cefde2 to your computer and use it in GitHub Desktop.
Ideal FFMpeg Settings for YouTube videos
ffmpeg -i input.mov -c:v libx264 -preset veryfast -profile:v high -crf 20 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low -strict -2 output.mp4
@AkBKukU
Copy link
Author

AkBKukU commented Dec 21, 2018

Based on: https://gist.github.com/mikoim/27e4e0dc64e384adbcb91ff10a2d3678

The preset is set to slow in their example which takes a lot of CPU time on higher resolution videos. I changed it to veryfast. This doesn't effect quality in any way, just the end file size.

The CPU crunching time vs. uploading time will be a YMMV thing, but on my 32 thread workstation it takes way longer than it's worth on 4k60 video.

I also set the crf to 20 for CPU time, in my testing I could not see a difference in the resulting upload. But this does directly effect the quality. (Lower == Better, Higher = Smaller)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment