0% found this document useful (0 votes)
4 views

ffmpeg video scaling

Uploaded by

angeloffire003
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

ffmpeg video scaling

Uploaded by

angeloffire003
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Video Scaling using ffmpeg

===========================

Convert 4k to 1080 (no change in codec)


ffmpeg -i input4kvid.mp4 -vf scale=1920:1080 -c:a copy output1080vid.mp4
Convert h.264 to h.265 (no change in resolution)
ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 -c:a copy output.mp4
Convert 4k(h.264) to 1080(h.265)
Downscaling + Change in compression codec
ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 -vf scale=1920:-2 -crf 20 -c:a copy
output.mp4
Options Explained
-i input file name or file path

-c:v libx265 -vtag hvc1 selecting compression. Default is libx264

-vf scale=1920:1080 or -vf scale=1920:-2 specifying output resolution

-c:a copy copy audio as it is without any compression

-preset slow ask compression algorithm to take more time & look for more areas for
compression. Default is medium. Other options are faster, fast, medium, slow,
slower

-crf 20 Compression quality

-crf 0 high-quality, low compression, large file

-crf 23 default

-crf 51 low-quality, high compression, small file

Extracting Audio
================

ffmpeg -i video.mp4 -b:a 320K -vn music.mp3

You might also like