Skip to content

Instantly share code, notes, and snippets.

@wngreene
Created April 2, 2020 22:49
Show Gist options
  • Save wngreene/3e979830606098d7d8419700216c1eef to your computer and use it in GitHub Desktop.
Save wngreene/3e979830606098d7d8419700216c1eef to your computer and use it in GitHub Desktop.
Extract frames from a video.
#! /usr/bin/env bash
# Extract frames from a video.
INPUT_FILE=${1}
OUTPUT_DIR=${2}
FMT=${3-%010d.png}
# QUALITY=${4-1}
if [ ! -d ${OUTPUT_DIR} ]; then
mkdir -p ${OUTPUT_DIR};
fi
pushd .
ffmpeg -i ${INPUT_FILE} -start_number 0 "${OUTPUT_DIR}/$filename${FMT}"
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment