Last active
August 29, 2015 14:16
-
-
Save stuf/c82e64dd30a4e92ff34b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -z $EVENT ]; then echo "Event code (EVENT) required"; exit 1; fi | |
if [ -z $REEL ]; then echo "Reel identifier (REEL) required"; exit 1; fi | |
# Defaults for params | |
if [ -z $TAKE ]; then echo "Take identifier (TAKE) not specified, defaulting to \"A\"."; fi | |
# Set default resolution if none specified | |
if [ -z $IW ]; then IW=1920; fi | |
if [ -z $IH ]; then IH=1080; fi | |
if [ -z $OUTPATH ]; then OUTPATH="."; fi | |
FOOTAGE_BASE=$(pwd)/Footage | |
IN=$(pwd)/Source/$EVENT/$REEL/$INFILE | |
OUT=$FOOTAGE_BASE/$EVENT/$REEL/$EVENT-$REEL-$TAKE.mov | |
# Ensure directory structure | |
if [ ! -d $FOOTAGE_BASE/$EVENT/$REEL ]; then | |
echo "Creating: $FOOTAGE_BASE/$EVENT/$REEL" | |
mkdir $FOOTAGE_BASE/$EVENT/$REEL | |
fi | |
# ffmpeg-relevant config | |
FILTER="crop=iw:iw/($IW/$IH):0:(ih/2)-((iw/($IW/$IH))/2),setdar=dar=16/9,setsar=1:1,scale=$IW:-1" | |
FPS=24 | |
PIXFMT=yuv444p10 | |
echo "" | |
echo "Event: $EVENT\tReel: $REEL/$TAKE\tResolution: $IW*$IH" | |
echo "Filter args:\t\t$FILTER" | |
echo "Infile:\t\t$IN" | |
echo "Outfile:\t$OUT" | |
echo "" | |
# Finally, put things in motion | |
ffmpeg -f image2 -pattern_type glob -i "$IN" -framerate $FPS \ | |
-vf $FILTER -sws_flags lanczos -an -r $FPS \ | |
-vcodec prores -profile:v 2 -pix_fmt $PIXFMT $OUT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment