I\'m wondering how to use FFMpeg to grap the middle frame of a video. I\'ve already written the C# to grab a frame at a certain time (ie pull one frame at second 3). But I\'
With simple shell scripting you can use ffprobe to get a machine readable duration output, bc to calculate the half point, and ffmpeg to make the frame:
input=input.mp4; ffmpeg -ss "$(bc -l <<< "$(ffprobe -loglevel error -of csv=p=0 -show_entries format=duration "$input")*0.5")" -i "$input" -frames:v 1 half.png
This eliminates any need for PHP, echo, awk, tr, grep, sed, etc.