<aside>

Install FFMPEG

  1. Download FFmpeg
  2. Extract
  3. Add FFmpeg to Your System Path

<aside>

Info and options

ffmpeg Documentation

<aside>

ffmpeg [global_options] {[input_file_options] -i input_url} ... {[output_file_options] output_url} ...

</aside>

Flag Purpose
-vf "fps=15" Drops frame rate to 15 (biggest size saver)
scale=512:-1 Resizes to 512 px width, keeping aspect ratio
flags=lanczos Smooth, high-quality downscaling
-gifflags -offsetting Reduces redundant frames
-y Overwrites existing output
-an Removes audio track
-c:v h264_nvenc NVIDIA GPU encoder
-cq:v 28 quality level (lower = higher quality + bigger size, higher = smaller size)Q
-preset fast Faster encode, slightly bigger file (slow for smaller size)
-b:v 980k Video bitrate
-t 4 time ([-][HH:]MM:SS[.m...])
-i "FILENAME.mp4” Indicates the element to input
-ss 0.5 Skip time from the start of the video
</aside>

<aside>

Compress MP4

No sound

ffmpeg -i "FILENAME.mp4" -c:v h264_nvenc -cq:v 32 -b:v 0 -preset slow -an "output.mp4"

Video for the cover art

ffmpeg -ss 0 -t 4 -i "FILENAME.mp4" -vf "fps=30,scale=720:-1:flags=lanczos" -loop 0 "FILENAME_CompWebp.webp"

Reduce GIF size

ffmpeg -i "FILENAME.gif" -vf "fps=15,scale=512:-1:flags=lanczos" -gifflags -offsetting -y output_small.gif

EXTRA: Convert to WEBM

ffmpeg -i "FILE_NAME.webm" -an -c:v libvpx-vp9 -crf 48 -b:v 0 -threads 12 "FILE_NAME_compressed.webm"

EXTRA: Convert to gif

ffmpeg -ss 0 -i "FILE_UnC.webm" -vf "fps=30,scale=320:-1:flags=lanczos,palettegen" "palette_NAME.png"
ffmpeg -ss 0 -i "FILE_UnC.webm" -i "palette_NAME.png" -filter_complex "fps=30,scale=720:-1:flags=lanczos[x];[x][1:v]paletteuse" "FILE_CompGif.gif"
  1. Convert to GIF
  2. Record 0 - 89 frames with .webm encoder. </aside>