bash - Handbrake CLI Script Fixes -
i have simple script run convert videos using handbrake cli. love modify script if files convert original file deleted.
here script stands:
#!/bin/sh in=$1 out=$2 cd "$in" inputitem in *;do /path/to/handbrakecli -i "$inputitem" -o "$out/${inputitem}.mp4" -e x264 -q 20.0 -a 1,1 -e faac,ac3 -b 160,160 -6 dpl2,auto -r 48,auto -d 0.0,0.0 -f mp4 -4 -x 960 --loose-anamorphic -m -x cabac=0:ref=2:me=umh:b-adapt=2:weightb=0:trellis=0:weightp=0 done
any ideas?
you can check exit status of program. successful exit returns zero.
to this, inside loop, after run, test exit status:
if [ $? -eq 0 ] rm "$inputitem" fi
Comments
Post a Comment