#!/bin/bash
if [ -z "$1" -o -z "$2" -o -z "$3" ]; then
- echo "Usage: $0 input start end"
- exit 1
+ echo "Usage: $0 input start end"
+ exit 1
fi
input="$1"
output="${input%%.*}-trimmed.${input##*.}"
if [ "$input" = "$output" ]; then
- echo "Internal error! Would overwrite "$input" with output file"
- exit 1
+ echo "Internal error! Would overwrite "$input" with output file"
+ exit 1
fi
ffmpeg -ss "$ss" -t "$duration" -i "$input" -acodec copy "$output"