#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/video-detect-scenes . ~/public_html/conf/.zsh/video-meta random () { local len=${1:-12} local str=$(cat /dev/urandom | tr -dc 'a-z' | head -c $len) echo $str } split-ds () { local ifile=$1 local nom=${ifile:r} local ext=${ifile:e} local src=${nom}-$(random).${ext} cp $ifile $src local beg=00:00:00 local end=${2:-$(video-length-one $src)} local t=0.3 # [0.1, 0.9] local det=det.txt local cut=cut.txt scene-detect \ -s $beg \ -i $src \ -e $end \ -t $t \ -o $det scene-time -i $det -o $cut scene-cut -i $src -c $cut local ooa_path=ooa local ooa=$ooa_path/$src mkdir -p $ooa mv $src $det $cut $ooa }