6 echo "usage: $(basename $0) <input> <inpoint in HH:MM:SS> <duration in HH:MM:SS> <output>"
9 [ -f "$1" ] || { usage 1>&2; exit 1; }
12 read INPOINT_HH INPOINT_MM INPOINT_SS <<< ${2//:/ }
13 read DURATION_HH DURATION_MM DURATION_SS <<< ${3//:/ }
15 # Remove leading zeros before performing the multiplications
16 INPOINT=$((${INPOINT_HH#0} * 60 * 60 + ${INPOINT_MM#0} * 60 + ${INPOINT_SS#0}))
17 DURATION=$((${DURATION_HH#0} * 60 * 60 + ${DURATION_MM#0} * 60 + ${DURATION_SS#0}))
19 [ -e "$4" ] && { echo "Output file already exists, bliling out!" 1>&2; exit 1; }
22 ges-launch-1.0 -s "$INPUT_FILE" $INPOINT $DURATION -o "$OUTPUT_FILE"