#!/bin/bash export scale="${2:-1}" midentify "$1" | perl -ne '/ID_VIDEO_HEIGHT=(\d+)/ and $height = $1; /ID_VIDEO_WIDTH=(\d+)/ and $width = $1; /ID_VIDEO_ASPECT=([\d.]+)/ and $aspect = $1; END { if ($aspect == 0) { $aspect = $width / $height; } print "$aspect\n"; }'