From 0813ee0a4a5c379086ee68ea570880ab707b678d Mon Sep 17 00:00:00 2001 From: FRancois Pelletier Date: Sat, 3 Feb 2024 21:58:16 +0000 Subject: [PATCH] Ajouter png-to-vertical-video-mp4.sh --- png-to-vertical-video-mp4.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 png-to-vertical-video-mp4.sh diff --git a/png-to-vertical-video-mp4.sh b/png-to-vertical-video-mp4.sh new file mode 100644 index 0000000..6e77f84 --- /dev/null +++ b/png-to-vertical-video-mp4.sh @@ -0,0 +1,21 @@ +declare -a ori=("v" "c" "h") + +tsfile=$(date -d "today" +"%Y%m%d%H%M%S") + +for f in "${ori[@]}" +do + for i in *.png + do + for j in $(seq 1 3) + do + convert $i -gravity center -background black -scale 540x960 -extent 540x960 $i-framed${f}$j.png + + done + done + mkdir -p frames${f}/ + convert -limit memory 4GiB -limit map 4GiB *-framed${f}*.png -delay 10 -morph 10 frames${f}/%05d.morph.png + ffmpeg -i frames${f}/%05d.morph.png -c:v libx264 -vf fps=15 -pix_fmt yuv420p output-${tsfile}-${f}.mp4 + rm -rf frames${f} +done + +rm -f *-framed*.png