I have pulled the Bash script from here, which checks the AVI file for bad frames using ffmpeg and cygwin extension. I am able to execute the code in Mingw. I put ffmpeg.exe (ren ffmpeg), cygwin1.dll & cygz.dll in Mingw's bin dir (/c/mingw/bin/). Now, I am looking to port this bash code to PowerShell. Can anyone shed some PowerShell light on this one?
Script: (path: /c/mygw/bin/AviConvert)
#!/bin/bash
FFMPEG="ffmpeg"
LIST=`find | grep \.avi$`
for i in $LIST; do
OUTP="$i.txt"
OUTP_OK="$i.txt.ok"
TMP_OUTP="$i.tmp"
if [ -f "$OUTP" -o -f "$OUTP_OK" ] ; then
echo Skipping "$i"
else
echo Checking "$i"...
RESULT="bad"
ffmpeg -v 5 -i "$i" -f null - 2> "$TMP_OUTP" && \
mv "$TMP_OUTP" "$OUTP" && \
RESULT=`grep -v "\(frame\)\|\(Press\)" "$OUTP" | grep "\["`
if [ -z "$RESULT" ] ; then
mv "$OUTP" "$OUTP_OK"
fi
fi
done