Last active
November 7, 2015 17:00
-
-
Save paselin/324c58051227f4df33cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ENCODE_QUE=() | |
FLG=0 | |
cd /home/pi/chinachu/ | |
PS=`ps ax | grep ./encode.sh | grep -v "grep ./encode.sh"` | |
echo ${PS} | |
if test -z "${PS}" ; then | |
for REC in `ls -F ./video/ | grep -v / | sed -e "s/\.m2ts//"` | |
do | |
FLG=0 | |
echo " rec_file:${REC}" | |
for ENC in `ls -F ./video/encoded/ | grep -v / | sed -e "s/\.mp4//"` | |
do | |
#echo "enc_file:$ENC" | |
if test ${REC} = ${ENC} ; then | |
echo "file encode already." | |
FLG=1 | |
break | |
fi | |
done | |
if test ${FLG} -eq 0 ; then | |
echo "recode add!!!!!!" | |
REC_FILE="${REC}.m2ts" | |
ENCODE_QUE=("${ENCODE_QUE[@]}" "${REC_FILE}") | |
fi | |
done | |
for TITLE in ${ENCODE_QUE[@]} | |
do | |
./encode.sh "./video/${TITLE}" | |
done | |
else | |
echo "encode now!!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment