Last active
August 27, 2023 10:57
-
-
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
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 | |
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