Skip to content

Instantly share code, notes, and snippets.

@statik
Created April 7, 2020 19:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statik/69e7ee7f11ef66d16ae4cbccee32a2ec to your computer and use it in GitHub Desktop.
Save statik/69e7ee7f11ef66d16ae4cbccee32a2ec to your computer and use it in GitHub Desktop.
convert video file to prores
#!/usr/bin/env bash
set -eo pipefail
USAGE='convert-to-prores inputfile [outputfile] [prores setting 1 to 5, default 3]'
DESCRIPTION='
Converts a video file to ProRes for playback on HyperDeck or NLE
The outputfile is optional, if not provided it will be based on the input file name
The profile switch takes an integer from -1 to 5 to match the ProRes profiles
Default is 3, hq 422
-1 auto (default)
0 proxy = 45Mbps YUV 4:2:2
1 lt = 102Mbps YUV 4:2:2
2 std = 147mpbs YUV 4:2:2
3 hq = 220 Mbps YUV 4:2:2
4 4444 = 330Mbps YUVA 4:4:4:4
5 4444xq = 500Mbps YUVA 4:4:4:4
Audio is defaulted to pcm_s16le.
Dependencies: requires ffmpeg command to be installed.
'
function usage() {
echo "$USAGE" "$DESCRIPTION" >&2
}
type ffmpeg >/dev/null 2>&1 || {
echo >&2 "Error: ffmpeg cli must be installed. Aborting."
usage
exit 1
}
[ $# -ge 1 ] || {
usage
exit 1
}
input="$1"
output="${2:-${1}.converted.mov}"
profile="${3:-3}"
echo "Converting from: $input to: $output"
ffmpeg -i "$input" -c:v prores_ks -profile:v "$profile" -c:a pcm_s16le "$output"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment