2022-01-06 12:31:30 -07:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
. /scripts/common.sh
|
|
|
|
|
|
|
|
run_in () {
|
|
|
|
(
|
|
|
|
cd $1; shift
|
|
|
|
"$@"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
while sleep 2; do
|
|
|
|
for mtype in audio video; do
|
|
|
|
ls $mtype | while read d; do
|
|
|
|
encode=/scripts/$mtype.encode.sh
|
|
|
|
workdir=$mtype/$d
|
|
|
|
[ -f $workdir/read.finished ] || continue
|
|
|
|
|
2022-01-06 17:33:25 -07:00
|
|
|
status "encoder" "$workdir"
|
2022-01-06 12:31:30 -07:00
|
|
|
if ! run_in $workdir $encode; then
|
|
|
|
log "$encode failed"
|
|
|
|
else
|
|
|
|
rm -rf $workdir
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
2022-01-06 17:33:25 -07:00
|
|
|
status "encoder" "idle"
|
2022-01-06 12:31:30 -07:00
|
|
|
done
|
|
|
|
|
|
|
|
# vi: ts=2 sw=2 et ai
|