ffmpeg -v error -i FILE -f null -
みたいな感じでファイルを検証するとか