Thursday, August 15, 2019

Reducing the size of a video

Calculate the bitrate you need by dividing 1 GB by the video length in seconds. So, for a video of length 16:40 (1000 seconds), use a bitrate of 1000000 bytes/sec:

ffmpeg -i input.mp4 -b 1000000 output.mp4

Additional options that might be worth considering is setting the Constant Rate Factor, which lowers the average bit rate, but retains better quality. Vary the CRF between around 18 and 24 — the lower, the higher the bitrate.

ffmpeg -i input.mp4 -vcodec libx265 -crf 20 output.mp4

Vary the codec as needed - libx264 may be available if libx265 is not, at the cost of a slightly larger resultant file size.

------------||
Other option is to use the program "Handbrake" for Linux.