26 lines
469 B
Bash
26 lines
469 B
Bash
#!/bin/bash
|
|
|
|
for file in "$@/.wmv";
|
|
do
|
|
ffmpeg -i "$@/$file" -c:v libx264 -crf 23 -c:a aac -q:a 100 "$@/${file/%wmv/mp4}"
|
|
done
|
|
|
|
TRIGGER_ERROR=0
|
|
COUNT=0
|
|
|
|
for file in "$@"/*.wmv;
|
|
do
|
|
if [ ! -f "./${file/%wmv/mp4}" ]; then
|
|
echo "E: File '${file/%wmv/mp4}' not found!"
|
|
TRIGGER_ERROR=1
|
|
COUNT=$((COUNT+1))
|
|
fi
|
|
done
|
|
|
|
if [ "$TRIGGER_ERROR" -eq 0 ]; then
|
|
echo "Seems fine"
|
|
fi
|
|
|
|
if [ "$TRIGGER_ERROR" -eq 1 ]; then
|
|
echo "$COUNT errors"
|
|
fi
|