Created
November 16, 2025 21:04
-
-
Save rsadwick/15f76014e290f243cfae732085e5039d to your computer and use it in GitHub Desktop.
FFMPEG: Get last frame as image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #get duration | |
| D=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 skate3.mp4) | |
| #compute seek before end | |
| SEEK=$(awk -v d="$D" 'BEGIN{printf "%.3f", (d>0.1?d-0.1:0)}') | |
| #seek and dump one frame | |
| ffmpeg -i skate3.mp4 -ss "$SEEK" -frames:v 1 -q:v 2 last_frame3.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment