Created
May 17, 2014 16:30
-
-
Save NelsonMinar/b00693feecc3b6673e36 to your computer and use it in GitHub Desktop.
Extract last frame of a video file
This file contains 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
#!/bin/bash | |
fn="$1" | |
of=${fn%.*}.jpg | |
lf=`ffprobe -show_streams "$fn" 2> /dev/null | awk -F= '/^nb_frames/ { print $2-1 }'` | |
rm -f "$of" | |
ffmpeg -i "$fn" -vf "select='eq(n,$lf)'" -vframes 1 "$of" 2> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment