Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save avirajkhare00/6ac8ab623b7de785f3bb0924ae7cab37 to your computer and use it in GitHub Desktop.
Save avirajkhare00/6ac8ab623b7de785f3bb0924ae7cab37 to your computer and use it in GitHub Desktop.
Upscale 1080p to 4k using ffmpeg

Upscale 1080p to 4k using ffmpeg

Just use the command below:

ffmpeg -i INPUT_FILE \
  -vf scale=3840x2160:flags=lanczos \
  -c:v libx264 \
  -crf 13 \
  -c:a aac -b:a 512k \
  -preset slow \
  OUTPUT_FILE

Where:

  • INPUT_FILE is the path to your input file
  • -vf scale=3840x2160:flags=lanczosis the new resolution using lanczos
  • -c:v libx264 is the codec H264
  • -crf 13 is the desired quality - From 0 to 51, the higher the number the worse. The smaller the number, the larger the file size
  • -c:a aac -b:a 512k is the audio codec and bitrate
  • -preset slow is the preset used. To go faster, use ultrafast
  • OUTPUT_FILE is the output file

Hope it helps.

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