From 96145418dda05ad9b3bfba0ef9603cd27145190e Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 11 Jun 2022 21:23:49 +0300 Subject: tools/video-util.sh: remove code that's not used anymore --- tools/lib.bash | 8 ++ tools/video-util.sh | 218 +--------------------------------------------------- 2 files changed, 10 insertions(+), 216 deletions(-) (limited to 'tools') diff --git a/tools/lib.bash b/tools/lib.bash index 1cf459b..1d73ab2 100644 --- a/tools/lib.bash +++ b/tools/lib.bash @@ -120,3 +120,11 @@ download() { die "neither curl nor wget found, can't proceed" fi } + +file_in_use() { + [ -n "$(lsof "$1")" ] +} + +file_mtime() { + stat -c %Y "$1" +} diff --git a/tools/video-util.sh b/tools/video-util.sh index 0a148d8..e7507ac 100755 --- a/tools/video-util.sh +++ b/tools/video-util.sh @@ -10,74 +10,9 @@ PROGNAME="$0" input= output= command= -motion_threshold=1 ffmpeg_args="-nostats -loglevel error" -dvr_scan_args="-q" config_dir=$HOME/.config/video-util config_dir_set= -write_data_prefix= -write_data_time= - -file_in_use() { - [ -n "$(lsof "$1")" ] -} - -get_mtime() { - stat -c %Y "$1" -} - -# converts date in format yyyy-mm-dd-hh.ii.ss to unixtime -date_to_unixtime() { - local date="$1" - date=${date//./-} - date=${date//-/ } - - local nums=($date) - - local y=${nums[0]} - local m=${nums[1]} - local d=${nums[2]} - local h=${nums[3]} - local i=${nums[4]} - local s=${nums[5]} - - date --date="$y-$m-$d $h:$i:$s" +"%s" -} - -filename_as_unixtime() { - local name="$1" - name="$(basename "$name")" - name="${name/record_/}" - name="${name/.mp4/}" - date_to_unixtime "$name" -} - -config_get_prev_mtime() { - local prefix="$1" - [ -z "$prefix" ] && die "config_get_prev_mtime: no prefix" - - local file="$config_dir/${prefix}_mtime" - if [ -f "$file" ]; then - debug "config_get_prev_mtime: $(cat "$file")" - cat "$file" - else - debug "config_get_prev_mtime: 0" - echo "0" - fi -} - -config_set_prev_mtime() { - local prefix="$1" - [ -z "$prefix" ] && die "config_set_prev_mtime: no prefix" - - local mtime="$2" - [ -z "$mtime" ] && die "config_set_prev_mtime: no mtime" - - local file="$config_dir/${prefix}_mtime" - - debug "config_set_prev_mtime: writing '$mtime' to '$file'" - echo "$mtime" > "$file" -} usage() { cat <