Last active
July 25, 2024 09:57
-
-
Save lmlsna/0d27155b661a230293e9127f295640cf to your computer and use it in GitHub Desktop.
Return the number of frames in a video file using ffprobe (ffmpeg)
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
#!/bin/bash | |
# Print the number of video frames in $1 | |
ffprobe -count_frames -v error -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 ${1} |
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
#!/bin/bash | |
# Extract a thumbnail image from video $1 every $3 seconds into directory $2 | |
ffmpeg -vf fps=1/${2} -i "${1}" "${3}/%03d.jpg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment