# Grabs snapshots from the video in a single Marvel url. The images are saved in
# a folder in the current directory.
#
# Snapshots are taken ever 5 seconds (`-r 0.2`) and skips the first 0.5 seconds
# of the video (`-ss 0.5`)
#
# Example usage:
#   ./grab_snaps_from_url.sh "https://marvel.zooxlabs.com/#/run/91d68b80fc483f8df5a7eabbbc45e04f"

marvel_run_url=$1
video_id=${marvel_run_url#*run/}

mkdir -p "./$video_id"
ffmpeg -i https://z3.zooxlabs.com/zoox-testdata/zim/scenario_videos/"$video_id".mp4 -ss 0.5 -r 0.2 "$video_id"/snap-%04d.png
montage "$video_id"/snap-*.png -geometry 1024x1024 "$video_id"/montage.png
