Skip to content

Instantly share code, notes, and snippets.

@dannyow
Created December 16, 2020 12:37
Show Gist options
  • Save dannyow/6fb26d21bff84e23da38e951cba3899d to your computer and use it in GitHub Desktop.
Save dannyow/6fb26d21bff84e23da38e951cba3899d to your computer and use it in GitHub Desktop.
Convert input video to all formats avail in avconvert
#!/usr/bin/env bash
# set -x
convert(){
avconvert --source $1 --output ${1/\.mp4/-$2.m4v} --preset $2
}
presets=(
"Preset640x480"
"Preset960x540"
"Preset1280x720"
"Preset1920x1080"
"Preset3840x2160"
"PresetAppleM4A"
"PresetAppleM4V480pSD"
"PresetAppleM4V720pHD"
"PresetAppleM4V1080pHD"
"PresetAppleM4VAppleTV"
"PresetAppleM4VCellular"
"PresetAppleM4ViPod"
"PresetAppleM4VWiFi"
"PresetAppleProRes422LPCM"
"PresetAppleProRes4444LPCM"
"PresetHEVC1920x1080"
"PresetHEVC1920x1080WithAlpha"
"PresetHEVC3840x2160"
"PresetHEVC3840x2160WithAlpha"
"PresetHEVCHighestQuality"
"PresetHEVCHighestQualityWithAlpha"
"PresetHighestQuality"
"PresetLowQuality"
"PresetMediumQuality"
"PresetPassthrough"
)
for i in ${presets[@]};
do
convert "${1}" "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment