How to reduce the file size of MPEG-4 multimedia format video with ffmpeg

The simplest tool to reduce the file size of MPEG-4 multimedia format video is ffmpeg. The most common process to shrink the file size is to use ffmpeg and reduce bitrate. Before we begin let’s first get some statistics about our sample mp4 video file foo.bar.

$ ffmpeg -i foo.mp4
...
17015 kb/s, 29.99 fps, 30 tbr, 90k tbn, 180k tbc (default)
...

The current file size is 22MB:

$ ls -hl foo.mp4 
-rw-rw-r--. 1 lubos lubos 22M Jul 23 10:56 foo.mp4

The current bitrate of our mp4 video file is 17015 kb/s.
The following linux command will reduce the bit rate of the above MP4 video file by approximately half and save the output as out.mp4:

$ ffmpeg -i foo.mp4 -b 8507k out.mp4

The new size of our mp4 file is:

$ ls -hl out.mp4 
-rw-rw-r--. 1 lubos lubos 12M Jul 23 11:14 out.mp4