Compressing Videos

When you mobile phone takes a video, it is optimised for writing to the mobile phone. It is not optimised for size reduction.

FFMPEG can reduce the file size with almost imperceptible quality loss, but usually if you use software, it will lose the metadata.

Fortunately there are some command lines than you can add to FFMPEG to preserve the metadata.

Copy over the audio:

-c:a copy

Copy over the metadata:

-map_metadata 0

Steps to encode videos

  1. Install FFmpeg Batch Converter. This tool allows easy management of batch items including the ability to re-create folder structures. https://ffmpeg-batch.sourceforge.io/

  2. Use the following settings:

3. Use the following command line parameter (if using Intel QuickSync HW Acceleration with H.265 HEVC):

ffmpeg -c:v hevc_qsv -global_quality 25 -look_ahead 1 -c:a copy -map_metadata 0

Other commands

If you don't have HW acceleration (unlikely on all processors since 2015 or so), you can use the following commands instead (H.265 HEVC), noting that this is very slow:

ffmpeg -vcodec libx265 -crf 28 -c:a copy -map_metadata 0

If you want complete compatibility, but are OK with larger files (twice as large), then you can use H.264 encoding:

With hardware acceleration available:

ffmpeg -c:v h264_qsv -global_quality 25 -look_ahead 1 -c:a copy -map_metadata 0

Without hardware acceleration (slow):

ffmpeg -c:v libx264 -crf 23 -c:a copy -map_metadata 0

Information about Intel QuickSync hardware acceleration:

https://trac.ffmpeg.org/wiki/Hardware/QuickSync