I have a .bash_profile script that uses FFMPEG to create a ProRes file from an image sequence. The name of the FFMPEG output file is taken from the current working directory. I'm fine taking the name from the parent directory because After Effects is set to create a folder for each image sequence render that has the same the name as the sequence.
This works fine if there's no spaces in the name. Example: My_Movie/My_Movie_00001.tif, etc gives me My_Movie_ProRes.mov
But I'd like to have it also work for folders with spaces in the name. I've tried adding quotes to various places but it just either fails or outputs as _ProRes.mov with no folder name at all.
pro () {
OUTPUT_NAME=${PWD##*/}
local fps=24;
local filename="${OUTPUT_NAME}"_ProRes.mov;
local ext=tif;
while test $# -gt 0; do
case "$1" in
-fps)
shift
fps=$1
shift
;;
-filename)
shift
filename=$1
shift
;;
-quality)
shift
quality=$1
shift
;;
*)
echo "$1 is not a recognized flag!"
return 0;
;;
esac
done
/usr/local/bin/ffmpeg -r $fps \
-f image2 -pattern_type glob \
-i "*?$ext" \
-codec:v prores_ks \
-pix_fmt yuva444p10le \
-vf scale=out_color_matrix=bt709 \
-profile:v 4444 \
$filename
}
SUCCESS! Thanks for your insight, especially John1024 and Jesse_b!
pro () {
OUTPUT_NAME="${PWD##*/}"
local fps=24;
local filename="${OUTPUT_NAME}"_ProRes.mov;
local ext=tif;
while test $# -gt 0; do
case "$1" in
-fps)
shift
fps=$1
shift
;;
-filename)
shift
filename=$1
shift
;;
*)
echo "$1 is not a recognized flag!"
return 0;
;;
esac
done
/usr/local/bin/ffmpeg -r $fps \
-f image2 -pattern_type glob \
-i "*?$ext" \
-codec:v prores_ks \
-pix_fmt yuva444p10le \
-vf scale=out_color_matrix=bt709 \
-profile:v 4444 \
"$filename"
}