#!/bin/bash
set -e -u
ratio=
if [ $1 = -r ]; then
	shift
	ratio=1
fi
in=$1
fps_ratio=`ffprobe -v 0 -of default=noprint_wrappers=1:nokey=1 -select_streams V:0 -show_entries stream=r_frame_rate "$in"`
if [ -n "$ratio" ]; then
	echo "$fps_ratio"
	exit
fi
python -c "print $fps_ratio.0"
