#!/bin/sh
# Extract poster image from input video.
# 
# Usage:
#     $0 inputvideofile outputimagefile
#
# Output format is determined by suffix, eg .jpg or .png.
inputvideofile=$1
outputimagefile=$2

#ffmpeg -ss 0.5 -i $inputvideofile -vframes 1 -s 480x300 -f image2 $outputimagefile
# -vf scale=640:360

# DHD20231227: libav no longer supported nor part of Homebrew.
#FFMPEG=avconv
FFMPEG=ffmpeg
exec $FFMPEG </dev/null -loglevel error -ss 0.5 -i $inputvideofile -frames:v 1 -f image2 $outputimagefile
