#!/bin/sh # check MP4 files by calling ffmpeg with the right options rc=0 for mp4 in "$@"; do echo -n "$mp4: " if ffmpeg -v error -i "$mp4" -f null -; then echo "OK" else echo "ERR" rc=1 fi done exit $rc