Skip to content

Instantly share code, notes, and snippets.

@ezlibs-com
Forked from mikoim/README.md
Created January 8, 2020 03:26
Show Gist options
  • Select an option

  • Save ezlibs-com/f75d4390012f5a4b44bb8633e981b37b to your computer and use it in GitHub Desktop.

Select an option

Save ezlibs-com/f75d4390012f5a4b44bb8633e981b37b to your computer and use it in GitHub Desktop.
YouTube recommended encoding settings on ffmpeg (+ libx264)
#/bin/sh
ffmpeg -i input -c:v libx264 -preset slow -profile:v high -crf 18 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a copy output

Parameters

I tested on ffmpeg 3.2 Hypatia.

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

Parameter YouTube recommends setting
-profile:v high High Profile
-bf 2 2 consecutive B frames
-g 30 Closed GOP. GOP of half the frame rate.
-coder 1 CABAC
-pix_fmt yuv420p Chroma subsampling: 4:2:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment