I have a code here to cut video or audio files. Unfortunately he is not running correctly. Can someone help me with this?
My system is Linux Mint 18.3 Cinnamon - 64 bit
Thanks in advance.
achim
Code: Select all
#!/bin/bash
INPUT=$(yad --width=600 --height=400 --file-selection --file-filter='*.mp3 *.mp4 *.avi') eval $(yad --width=400 --form --field=start --field=end --field=output:SFL "00:00:00" "00:00:00" "${INPUT/%.*}-out.${INPUT##*.}" | awk -F'|' '{printf "START=%s\nEND=%s\nOUTPUT=\"%s\"\n", $1, $2, $3}') [[ -z $START || -z $END || -z $OUTPUT ]] && exit 1 DIFF=$(($(date +%s --date="$END")-$(date +%s --date="$START"))) OFFSET=""$(($DIFF / 3600)):$(($DIFF / 60 % 60)):$(($DIFF % 60)) ffmpeg -ss "$START" -t "$OFFSET" -i "$INPUT" "$OUTPUT"