!/bin/sh
inotifywait -rmq /disk1/ftp
MY_SAVEIFS=$IFS
IFS=$'\n'
path=/disk1/$1/
files=$(ls $path)
for file in $files
do
ret=ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 -i $path$file
if [[ "$file" =~ "Invalid data found when processing input" ]];then
echo $ret
fi
done
IFS=$MY_SAVEIFS
错误示例:
$ ./finished.sh ftp
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x64e2080] moov atom not found
/disk1/ftp/126298_0927_38.mp4: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x6330080] moov atom not found
/disk1/ftp/128367_0604_38.mp4: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x6a74080] moov atom not found
/disk1/ftp/128617_1121_39.mp4: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x59aa080] moov atom not found
/disk1/ftp/128787_1029_59.mp4: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x6d95080] moov atom not found
/disk1/ftp/128807_0727_38.mp4: Invalid data found when processing input
标签:脚本,视频,ftp,disk1,when,Invalid,mp4,完整性,found
From: https://www.cnblogs.com/netstat/p/18075716