Skip to content

Instantly share code, notes, and snippets.

@nkint
Last active September 7, 2023 05:18
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save nkint/8563954 to your computer and use it in GitHub Desktop.
Save nkint/8563954 to your computer and use it in GitHub Desktop.
ffmpeg in the shell: extracting the first frame of video
i=1
for avi in *.mp4; do
name=`echo $avi | cut -f1 -d'.'`
jpg_ext='.jpg'
echo "$i": extracting the first frame of the video "$avi" into "$name$jpg_ext"
ffmpeg -loglevel panic -i $avi -vframes 1 -f image2 "$name$jpg_ext"
i=$((i+1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment