Back to Blog
How to compress video files using ffmpeg6/26/2023 In addition to the previous two, selecting a preset can also increase quality but will increase file size. $ ffmpeg -i input.mp4 -c:v libx264 -crf 18 output.mp4 According to the documentation, values between 17-28 are “virtually lossless” visually but technically not. The default value is 23 while 51 is the worst quality. The setting for a lossless output is 0, the lower the number the higher the quality but larger the file size. The H.264 codec can be set as seen in the example below: $ ffmpeg -i input.mp4 -c:v libx264 output.mp4Īnother useful command is setting the constant rate factor (-crf) a rate control mode. This assumes that your FFMPEG installation is configured with -enable-libx264. Libx264 is used entirely throughout this book. It is recommended that the H.264 aka libx264 encoder is used with most video formats. This is usually done to perform the filter quicker as the higher the quality, the longer the command completion time.Ĭompression can be avoided using recommended codecs and setting quality. This is one of the most asked questions on google about FFMPEG and for a good reason, by default automatic compression is added depending on the filter.
0 Comments
Read More
Leave a Reply. |