Created
July 31, 2020 22:09
-
-
Save salmedina/986ac98ed7f1470b7f1cb4f039dd78ec to your computer and use it in GitHub Desktop.
FFMPEG extract keyframes from video
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 | |
START_TIME=$1 | |
VIDEO_PATH=$2 | |
DURATION=$3 | |
OUTPUT_DIR=$4 | |
ffmpeg -ss ${START_TIME} -i ${VIDEO_PATH} -t ${DURATION} -q:v 2 -vf select="eq(pict_type\,PICT_TYPE_I)" -vsync 0 ${OUTPUT_DIR}/%03d.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script extracts the I-frames from a given video in case it has them. If it doesn't, then it will extract all the frames.