
Here, the -i flag denotes the input file, media.y4m, -vcodec denotes the video codec, -crf is the Constant Rate Factor, and media.mp4 is the output file.Ī process should start which looks like this: ffmpeg -i media.y4m -vcodec libx265 -crf 28 media.mp4 Execute the command replacing the video file you want to compress. In this article, we will take a video file media.y4m and compress it. Tweaking with the CRF value can help you get a balance between the required video size and the required video quality using FFmpeg. If you increase the value of CRF by 6, the video size will be reduced to half. CRF 17-18 is recommended value as the range is visually lossless. CRF 0 doesn’t lose quality at all, while CRF 51 is the worst quality. Lower CRF results in high-quality videos as it produces a high bitrate. Higher CRF results in higher video compression. The CRF value of 0 to 51 is ideal with x265 codecs. We’ll use the x265 codec because it is a free library for encoding videos into the H.254/MPEG-H HEVC compression type. We select a small-sized container with a good codec to encode the video, low fps, and low bitrate. To compress videos, we apply a basic technique. Use FFmpeg to Reduce Video Size (Compress) Press Y, and the installation will begin, and FFmpeg will be installed on your Linux machine.
Ffmpeg compress video install#
Once you execute the command and enter your password, it will ask for your permission to install the package.
Ffmpeg compress video code#
Please follow the code given for your distribution.įor Debian/Ubuntu: sudo apt-get install ffmpegįor REHL/CentOS/Fedora: sudo dnf install ffmpeg Following are the commands you need to execute to install FFmpeg. Installing FFmpeg on any Linux distribution is fairly easy.
Ffmpeg compress video software#
FFmpeg is the backbone for many software projects and various popular media players like VLC, YouTube, and iTunes.

MPEG, which stands for Moving Picture Experts Group, is a video file saved in digital format. Since it is a command line utility, you can just follow the steps mentioned in this article and reduce your video size. Using FFmpeg might be challenging to some users, but it is not that complicated. Compression helps reduce the size of a file takes while preserving the file content. Sometimes, large file sizes aren’t feasible for people who are low on storage or who have to frequently send media files over the internet. The tool is very useful if you need to send large media files via the internet. Some of its applications are format transcoding, video editing, video scaling, etc. It works great for compression but isn’t limited to it. It can be used to compress video size on almost all platforms. FFmpeg is an open-source collection of libraries and tools used to process audio, video, and other multimedia-related files.
