From b344d0b7621a2a13b19cfe8473e8b7d97333bbb5 Mon Sep 17 00:00:00 2001 From: Tonton Th Date: Sun, 26 Jan 2025 19:32:18 +0100 Subject: [PATCH] a lot a better things --- tools/config.sh | 9 +++++++++ tools/linkfarmer.sh | 17 ++++++++++------- tools/mkloop.sh | 12 ++++++------ tools/plot-timing.sh | 20 ++++++++++++-------- 4 files changed, 37 insertions(+), 21 deletions(-) create mode 100644 tools/config.sh diff --git a/tools/config.sh b/tools/config.sh new file mode 100644 index 0000000..a604381 --- /dev/null +++ b/tools/config.sh @@ -0,0 +1,9 @@ + + +Img_Width=1024 +Img_Height=768 + +TEXTCOL="orange" +STROKOL="darkblue" + +NBFRAMES=360 diff --git a/tools/linkfarmer.sh b/tools/linkfarmer.sh index 1d6f661..f35c239 100755 --- a/tools/linkfarmer.sh +++ b/tools/linkfarmer.sh @@ -2,13 +2,13 @@ set -e ; set -u +source tools/config.sh + IDX=0 SPOOL="frames/Spool" SEQNAME="none" TMP="WS/tmp.png" FONTE="Helvetica-Bold" -TEXTCOL="yellow" -STROKOL="darkblue" source tools/fonctions.sh @@ -72,7 +72,7 @@ faire_le_titre () { echo "faire le titre" -local NBRE=240 +local NBRE=280 local SRC="frames/passage/00099.png" local GRAY="/dev/shm/tmp-titre.png" @@ -84,7 +84,7 @@ do convert ${GRAY} \ -gravity north \ -font $FONTE \ - -pointsize 172 \ + -pointsize 146 \ -kerning 6 \ -fill $TEXTCOL \ -strokewidth 3 -stroke $STROKOL \ @@ -103,10 +103,14 @@ local NBRE=180 datetime=$(LANG=fr date -u +"%Y/%m/%d") echo $datetime | tee -a WS/log +local SRC="frames/escadrille/00299.png" +local GRAY="/dev/shm/tmp-titre.png" +convert -colorspace gray -colors 27 $SRC $GRAY + for foo in $(seq 0 $NBRE) do Ypos=$(( foo + 20 )) - convert "WS/negatif.png" \ + convert ${GRAY} \ -gravity north \ -font $FONTE \ -pointsize 86 \ @@ -118,7 +122,7 @@ do -pointsize 48 \ -strokewidth 1 \ -gravity south \ - -annotate +0+170 "${datetime}" \ + -annotate +0+140 "${datetime}" \ ${TMP} # identify ${TMP} copy_a_file ${TMP} @@ -132,7 +136,6 @@ figlet "Link farmer" rm -f frames/Spool/*.png -# tools/plot-timing.sh faire_le_titre linkfarm hexabenz diff --git a/tools/mkloop.sh b/tools/mkloop.sh index fe1581e..b6a3508 100755 --- a/tools/mkloop.sh +++ b/tools/mkloop.sh @@ -1,15 +1,15 @@ #!/bin/bash set -e ; set -u + +source tools/config.sh source tools/fonctions.sh SEQNAME="$1" -NBFRAMES=360 - echo "Running $0 $SEQNAME" >> WS/log -DIMS="-W1280 -H1024" +DIMS="-W$Img_Width -H$Img_Height" POVOPT="+q9 +A -d ${DIMS} -WT6" echo $POVOPT ; echo ; sleep 2 @@ -30,12 +30,12 @@ do continue fi set -e - txt=$(printf "%s %03d" ${SEQNAME} $frame | tr '0' 'o') + txt=$(printf "%s %03d" ${SEQNAME} $frame | tr '01' 'ol') # echo $frame $img $txt convert ${TMPIMG} \ -font Courier-Bold \ - -pointsize 18 \ - -fill Gray80 \ + -pointsize 16 \ + -fill ${TEXTCOL} \ -gravity south \ -annotate +0+5 "$txt" \ ${img} diff --git a/tools/plot-timing.sh b/tools/plot-timing.sh index e683edd..4509d25 100755 --- a/tools/plot-timing.sh +++ b/tools/plot-timing.sh @@ -2,6 +2,8 @@ set -ue +source tools/config.sh + TMPFILE="/dev/shm/plot-timing.tmp" IMAGE="timing.png" @@ -12,12 +14,14 @@ else sequence="escadrille" fi -echo "plot timing $sequence" >> WS/log +# echo "plot timing $sequence" >> WS/log -grep $sequence WS/mp4.timing | tail -3600 | awk ' \ +grep $sequence WS/mp4.timing | tail -3600 | awk \ + -v nbframes=$NBFRAMES \ +' \ BEGIN { \ - nbrames=360; \ - for (foo=0; foo $TMPFILE -# cat -n $TMPFILE | tail # ; exit +# head $TMPFILE ; exit gnuplot << __EOC__ - set term png size 1280,1024 + set term png size $Img_Width,$Img_Height set output "timing.png" set grid set xrange [:360] @@ -58,5 +62,5 @@ gnuplot << __EOC__ "/dev/shm/plot-timing.tmp" u 1:2 w l lc "#000000" t "moyenne", __EOC__ -convert -negate -colorspace gray -level -33% $IMAGE WS/negatif.png +convert -negate -level -33% $IMAGE WS/negatif.png