I'm Making a script to get DAR information out of video file. to do that, I'm using this script with success
DAR=$(ffmpeg -i "$DOSSIER/$OLD_NAME.$EXTENSION" -hide_banner 2>&1 | grep -i -oP "DAR [0-9]+:[0-9]+")
# if DAR not exist set it to 1
if [ -z "$DAR" ];
then
DAR="DAR 1:1"
fi
X_DAR=$(echo "${DAR:4}" | cut -d: -f1)
Y_DAR=$(echo "${DAR:4}" | cut -d: -f2)
My main problem is that sometimes, videos have multiple DAR so my output looks like
echo $DAR
DAR 16:9 DAR 5:4 DAR 234:211
from there, I would need the biggest number of all operations available behind the DAR. and there could be 2 DAR available or 10.
any ideas? thanks