UPDATE
Thank you everyone for sharing up your suggestions. I was able to make the work properly by modifying it as follows.
#!/bin/bash
ROOTPATH="/Volumes/NVME-RAID/ASSET-Processing/CORRUPT-SCAN/SCAN " # manually define root path to your folder that has subfolders
for subdir in *; do
cd ${ROOTPATH}${subdir}
mkdir 00errors
for path in *.{MOV,mov,MP4,mp4}; do
ffmpeg -i "${path}" -f null -; echo$?
RC=$?
if [ "${RC}" -ne "0" ]; then
# Do something to handle the error.
mv ${path} ./00errors
fi
done
cd ../
done
The only issue i have now is that it does not appear to be traversing the subfolders. As I understand it it should create a "00errors" folder in within EACH sub folder and move the errors files within that sub folder.
trying to sift through 14TB of recovered video...
I'm trying to figure out how to properly convert this script so it will run on a bash/MacOS. I'm coming to a wall with the "ROOTPATH" call because MacOS doesn't use /mnt
#!/bin/bash
ROOTPATH="/mnt/f/00test/" # manually define root path to your folder that has subfolders
for subdir in *; do
cd ${ROOTPATH}${subdir}
mkdir 00errors
for path in *.mp4; do
ffmpeg error -i "${path}"
RC=$?
if [ "${RC}" -ne "0" ]; then
# Do something to handle the error.
mv ${path} ./00errors
fi
done
cd ../
done
REF Quickly check the integrity of video files inside a directory with ffmpeg