Last active
August 8, 2022 15:39
-
-
Save carlok/483b61309a6e50a3a753c54b08ce4719 to your computer and use it in GitHub Desktop.
Bash to extract frames from a list of MP4 using 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
# choose one or the other | |
# 1 | |
# oneliner: all JPGs in a single folder (don't use it when you are going to have thousands of images) | |
for i in $(ls 2022_07_*.MP4 | awk -F "." '{print $1}'); do ffmpeg -i $i.MP4 -qscale:v 1 -s 1920x1080 $(printf '%s' $i)_%8d.jpg; done | |
# 2 | |
# each mp4 generates its own jpg folder | |
for i in $(ls 2022_07_13_*.MP4 | awk -F "." '{print $1}') | |
do | |
mkdir $i | |
ffmpeg -i $i.MP4 -qscale:v 1 -s 1920x1080 $i/$(printf '%s' $i)_%8d.jpg | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment