Skip to content

Instantly share code, notes, and snippets.

@mandymozart
Last active August 27, 2023 10:57
Show Gist options
  • Save mandymozart/fee1941a3d8ed5cdfc8c45464a275b58 to your computer and use it in GitHub Desktop.
Save mandymozart/fee1941a3d8ed5cdfc8c45464a275b58 to your computer and use it in GitHub Desktop.
Using ffmpeg to extract one frame per second as a still image from video file for photogrametry
#!/bin/bash
input_file="DJI_0155.MP4" # Replace with the path to your input MP4 file
output_folder="frames" # Replace with the name of the folder where you want to save frames
# Create the output folder if it doesn't exist
mkdir -p "$output_folder"
# Use FFmpeg to extract frames
ffmpeg -i "$input_file" -vf "fps=1" "$output_folder/frame_%04d.jpg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment