Skip to content

Instantly share code, notes, and snippets.

@ob7
ob7 / convert-videos-for-web.sh
Last active May 2, 2024 03:16 — forked from jmwhittaker/gist:8516514
Use FFmpeg to resize and generate .mp4 & .webm videos from any source video.
#!/bin/bash
#Scaling
#- Scale can be used as is which will set the height to 560 but keep aspect ratio for width.
#- Other options include setting both with & height
#- Watch out for sizing errors when not divisible by 2
if [[ ! "$1" || ! "$2" || ! "$3" ]] || [[ "$1" = '--help' ]]; then
if [[ "$1" = '--help' ]]; then
echo " "