diff --git a/bin/ffconv b/bin/ffconv index fe1429d..618738e 100755 --- a/bin/ffconv +++ b/bin/ffconv @@ -11,6 +11,7 @@ sfargs+=("move;m;DIRECTORY;;Move old files to DIRECTORY (omits --keep)") sfexamples+=("ffconv mp3 opus;Convert all mp3 files to opus") sfexamples+=("ffconv -m trash mp4 mkv;Convert all mp4 to mkv and move the original ones to './trash'") sfexamples+=("ffconv -d ~/music -l wma mp3;List all wma files from '~/music' and ask for converting them to mp3") +sfdeps=("ffmpeg") source "$(dirname $0)/../lib/sf" diff --git a/bin/ffcut b/bin/ffcut index 770a45a..ba5db91 100755 --- a/bin/ffcut +++ b/bin/ffcut @@ -8,23 +8,23 @@ sfargs+=("out;o;FILE;cutted_;Save extracted part to FILE") sfargs+=("to;t;TIMESTAMP/DURATION;end;Extract to TIMESTAMP/DURATION") sfexamples+=("ffcut -t 5 video.mp4 -o cut.webm;Extract the first five seconds of 'video.mp4' to 'cut.webm'") sfexamples+=("ffcut -f 00:10:30 -t 00:14:15 video.mp4;Extract the part from 00:10:30 to 00:14:15 from 'video.mp4'") +sfdeps=("ffmpeg") source "$(dirname $0)/../lib/sf" # Handle missing parameters -[ "$from" == 0 ] && [ "$to" == "end" ] && sferr "Set at least '--from' or '--to'" +[ "$from" == 0 ] && [ "$to" == "end" ] && sferr "Set at least ${sftbf}--from${sftrs} or ${sftbf}--to${sftrs}" # Set default value for output file [ "$out" == "cutted_" ] && out="$(dirname "$FILE")/cutted_$(basename "$FILE")" -echo "Cutting file ${sftbf}$(basename "$FILE")${sftrs}" - # Set additional ffmpeg arguments args=() [ "$to" != "end" ] && args+=("-to" "$to") [ "${FILE##*.}" == "${out##*.}" ] && args+=("-c" "copy") # Execute ffmpeg +echo "Cutting file ${sftbf}$(basename "$FILE")${sftrs}" ffmpeg -hide_banner -loglevel error -i "$FILE" -ss "$from" "${args[@]}" "$out" [ "$?" == "0" ] && echo "The extracted part was saved to ${sftbf}$out${sftrs}"