-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to make a movie from simulation images
- Loading branch information
1 parent
18f6997
commit 54d9a49
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
|
||
CONVERT_EXE=/sw/andes/spack-envs/base/opt/linux-rhel8-x86_64/gcc-8.3.1/imagemagick-7.0.8-7-srnwz5bn26ielesvto2lrctsw4qby573/bin/convert | ||
RENAME_EXE=/gpfs/alpine2/ast196/proj-shared/wibking/spack/opt/spack/linux-rhel8-zen2/gcc-9.3.0/rename-1.600-jzccmpqqd2tu2muki2fd3o2aehxkdvr4/bin/rename | ||
FFMPEG_EXE=/gpfs/alpine2/ast196/proj-shared/wibking/spack/opt/spack/linux-rhel8-zen2/gcc-9.3.0/ffmpeg-7.0.2-ywl5f5ldeogjs3jtgitdufzpksnswgit/bin/ffmpeg | ||
|
||
set -x | ||
|
||
## rename *.png files | ||
|
||
$RENAME_EXE 's/\d+/sprintf("%07d",$&)/e' -- *.png | ||
|
||
## resize frames | ||
|
||
for file in *.png; | ||
do | ||
$CONVERT_EXE $file -resize 2048x2048 $(basename -s .png $file).resize_large.png | ||
done | ||
|
||
## make movie | ||
FPS=10 | ||
FILTERS="pad=ceil(iw/2)*2:ceil(ih/2)*2:color=white, drawtext=fontfile=/usr/share/fonts/google-droid/DroidSans.ttf:text='QED-QUOKKA Simulation':fontcolor=white:fontsize=48:box=1:[email protected]:boxborderw=5:x=0.9*(w-text_w):y=0.9*(h-text_h)" | ||
|
||
$FFMPEG_EXE -framerate $FPS -pattern_type glob -i "slices_*.resize_large.png" -r $FPS -vcodec libx264 -vf "$FILTERS" -pix_fmt yuv420p -preset slow -tune animation -crf 18 slice_movie_large.mov |