Things to do before sharing videos

!
Warning: This post is over 365 days old. The information may be out of date.

Compress the video

A popular chat app in Korea, KakaoTalk, limits video size to 300 MB or less. A video I was trying to send was about 418 MB with a resolution of 4K. Unfortunately, KakaoTalk won’t automatically convert your video to fit the size limitation, which is a shame, but thankfully ffmpeg can help you compress your video.

Run the following:

ffmpeg -i video.mp4 -crf 24 output.mp4

Experiment with the number after the -crf flag. 24 reduced my 418 MB video down to about 122 MB. Higher values will create smaller video files but reduce quality, and vice versa.

Scale down the video

If that’s not enough, you can scale down your video to decrease the file size. Use:

ffmpeg -i video -vf scale=xxx:xxx output.mp4

Where xxx denotes the video size. Make sure the original video dimension is divisible by this value. For example, my video is a 3840 by 2160 video. To scale it down to a 1080p video, I would use the dimensions 1920 by 1080 (divide by half). My ffmpeg parameter would therefore be scale=1920:1080.

After the resize, the video size dropped down to 36 MB, which is more than acceptable for my needs!

Strip location metadata

If you shot your video on your phone or a GPS-enabled camera, then your video may have location metadata embedded. You don’t want to leak your home address or anything like that if you’re sharing your video on the Internet.

ffmpeg also has a flag to strip out the location metadata (seriously, ffmpeg developers are awesome!) Run the following:

ffmpeg -i video.mp4 -metadata location="" -metadata location-eng="" output.mp4

This strips out the location metadata from your video.

comments