Использование, для Bash
width=$(ffprobe -v quiet -show_entries stream=width -select_streams v:0 -of compact=p=0:nk=1 input.mkv)
height=$(ffprobe -v quiet -show_entries stream=height -select_streams v:0 -of compact=p=0:nk=1 input.mkv)
Для CMD, в Windows
for /f %i in ('ffprobe -v quiet -show_entries "stream=width" -of "compact=p=0:nk=1" input.mkv') do set width=%i
for /f %i in ('ffprobe -v quiet -show_entries "stream=height" -of "compact=p=0:nk=1" input.mkv') do set height=%i