Sure, here are some FFmpeg tricks you can use to shrink a 1GB file down to <16MB:

  • Use a lower bitrate. The bitrate is the amount of data that is used to encode a video. A lower bitrate will result in a smaller file size, but it may also result in a lower quality video. To set the bitrate, use the -b:v option. For example, to set the bitrate to 1000kbps, you would use the following command:
ffmpeg -i input.mp4 -b:v 1000k output.mp4
  • Use a smaller resolution. The resolution is the number of pixels in a video. A smaller resolution will result in a smaller file size, but it may also result in a lower quality video. To set the resolution, use the -vf scale option. For example, to scale the video to 720p, you would use the following command:
ffmpeg -i input.mp4 -vf scale=1280:720 output.mp4
  • Use a different codec. The codec is the algorithm that is used to encode a video. Different codecs have different file sizes and different qualities. To choose a different codec, use the -vcodec option. For example, to use the H.264 codec, you would use the following command:
ffmpeg -i input.mp4 -vcodec libx264 output.mp4
  • Use the -crf option. The -crf option allows you to control the quality of the video. A lower value will result in a higher quality video, but it will also result in a larger file size. A higher value will result in a lower quality video, but it will also result in a smaller file size. The default value for -crf is 23. To set a different value, use the following command:
ffmpeg -i input.mp4 -crf 18 output.mp4
  • Use the -qscale option. The -qscale option is similar to the -crf option, but it is not as precise. A lower value will result in a higher quality video, but it will also result in a larger file size. A higher value will result in a lower quality video, but it will also result in a smaller file size. The default value for -qscale is 2. To set a different value, use the following command:
ffmpeg -i input.mp4 -qscale 1 output.mp4
  • Use the -vframes option. The -vframes option allows you to specify the number of frames in the output video. This can be useful if you only want to keep a portion of the original video. For example, to keep the first 30 seconds of the video, you would use the following command:
ffmpeg -i input.mp4 -vframes 30 output.mp4
  • Use the -an option. The -an option will disable the audio track in the output video. This can be useful if you only want to compress the video portion of the file.
  • Use the -sn option. The -sn option will disable the subtitle track in the output video. This can be useful if you only want to compress the video portion of the file.
  • Use the -y option. The -y option will overwrite the output file if it already exists. This is useful if you want to overwrite the previous output file with the new, compressed file.

It is important to note that the quality of the output video will depend on the settings that you use. If you set the bitrate too low, the video may be pixelated or blurry. If you set the resolution too low, the video may look choppy. And if you set the -crf or -qscale value too high, the video may be blocky or noisy.

It is also important to note that compressing a video will take some time. The amount of time it takes will depend on the length of the video and the settings that you use.

If you are not sure how to use FFmpeg, there are many tutorials available online. You can also find a list of FFmpeg commands on the FFmpeg website.

Edit

Pub: 30 May 2023 15:08 UTC

Views: 50