From 36e8bd0c236cc3e659f8db04ade330c8a60c571a Mon Sep 17 00:00:00 2001 From: jorgevasquezp Date: Fri, 9 Nov 2018 10:45:57 -0800 Subject: [PATCH] Added argument parsing options for custom start_number and frame_rate to be able to handle image_sequences. --- bash/make_pr4444.sh | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/bash/make_pr4444.sh b/bash/make_pr4444.sh index c3a9ebf..425fdea 100755 --- a/bash/make_pr4444.sh +++ b/bash/make_pr4444.sh @@ -1,3 +1,40 @@ +while getopts "n:r:" opt; do + case ${opt} in + n ) + start_number=$OPTARG + ;; + r ) + frame_rate=$OPTARG + ;; + \? ) + echo "Invalid option: $OPTARG" 1>&2 + ;; + : ) + echo "Invalid option: $OPTARG requires an argument" 1>&2 + ;; + esac +done + +if [ -z "$start_number" ] +then + n=; +else + n='-start_number '$start_number; +fi + +if [ -z "$frame_rate" ] +then + r=; +else + r='-r '$frame_rate; +fi + +shift "$(($OPTIND -1))" + + + for i; - do ffmpeg -i "$i" -f mov -c:v prores_ks -profile:v 4444 -pix_fmt yuva444p10le -strict -2 -vendor ap10 "${i%.*}_pr4444.mov" ; + do + output=$(echo $i | sed 's/_%0[[:digit:]]d//'); + ffmpeg $n $r -i "$i" -f mov -c:v prores_ks -profile:v 4444 -pix_fmt yuva444p10le -strict -2 -vendor ap10 "${output%.*}_pr4444.mov" ; done;