检查视频完整性脚本

!/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
posted @   从雍和宫走到电影学院  阅读(33)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
点击右上角即可分享
微信分享提示