Created
May 4, 2021 12:50
-
-
Save adujardin/f24ce05d9a5ff52a3b5a4d5d4b4aca1f to your computer and use it in GitHub Desktop.
Create mp4 video from image sequence (in all directories in the same folder)
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
dest="/foo/bar" | |
curr="/foo/bar2/" | |
mkdir "${dest}" | |
dirs=($(find . -type d)) | |
for dir in "${dirs[@]}"; do | |
echo "=========================" | |
echo $dir | |
cd "${curr}${dir}" | |
pwd | |
#ffmpeg -framerate 20 -pattern_type glob -i '*.jpg' -c:v libx264 -r 30 -pix_fmt yuv420p "${dir}.mp4" | |
ffmpeg -r 10 -pattern_type glob -i '*.jpg' -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" -vcodec libx264 -y -an "${dir}.mp4" | |
mv "${dir}.mp4" "${dest}/" | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment