X-Git-Url: https://git.ao2.it/experiments/gstreamer.git/blobdiff_plain/b495fe30b5440d694828dbd6617690f48fea20b5..bd161b37c12141ed5c311f03a560b5915ec08527:/shell/ges-cut-clip.sh diff --git a/shell/ges-cut-clip.sh b/shell/ges-cut-clip.sh index d1a9aec..8ffc814 100755 --- a/shell/ges-cut-clip.sh +++ b/shell/ges-cut-clip.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e @@ -12,10 +12,11 @@ INPUT_FILE="$1" read INPOINT_HH INPOINT_MM INPOINT_SS <<< ${2//:/ } read DURATION_HH DURATION_MM DURATION_SS <<< ${3//:/ } -INPOINT=$(($INPOINT_HH * 60 * 60 + $INPOINT_MM * 60 + $INPOINT_SS)) -DURATION=$(($DURATION_HH * 60 * 60 + $DURATION_MM * 60 + $DURATION_SS)) +# Remove leading zeros before performing the multiplications +INPOINT=$((${INPOINT_HH#0} * 60 * 60 + ${INPOINT_MM#0} * 60 + ${INPOINT_SS#0})) +DURATION=$((${DURATION_HH#0} * 60 * 60 + ${DURATION_MM#0} * 60 + ${DURATION_SS#0})) -[ -e "$4" ] && { echo "Output file already exists, bliling out!" 1>&2; exit 1; } +[ -e "$4" ] && { echo "Output file already exists, bailing out!" 1>&2; exit 1; } OUTPUT_FILE="$4" -ges-launch-1.0 -s "$INPUT_FILE" $INPOINT $DURATION -o "$OUTPUT_FILE" +ges-launch-1.0 +clip "$INPUT_FILE" inpoint=$INPOINT duration=$DURATION -o "$OUTPUT_FILE"