From 2c1687f82b4d74e27315670ed39687a382460f96 Mon Sep 17 00:00:00 2001 From: tTh Date: Sat, 8 Jul 2023 12:43:00 +0200 Subject: [PATCH] a few oops... --- funcs/utils.c | 2 +- scripts/capture.sh | 10 +++++++--- scripts/conf.sh | 7 +++++-- tools/fimgextract.c | 14 ++++++++------ 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/funcs/utils.c b/funcs/utils.c index b8e64be..3106bf8 100644 --- a/funcs/utils.c +++ b/funcs/utils.c @@ -134,7 +134,7 @@ if (notused) { fprintf(stderr, "notused was %d, must be 0 in %s\n", notused, __func__); } -if (verbosity > 1) fprintf(stderr, "parsing '%s'\n", str); +if (verbosity > 1) fprintf(stderr, "%s: parsing '%s'\n", __func__, str); foo = sscanf(str, "%d,%d,%d,%d", &w, &h, &x, &y); if (4 == foo) { r->x = x, r->y = y, r->w = w, r->h = h; diff --git a/scripts/capture.sh b/scripts/capture.sh index 235b6b2..74f9ed1 100755 --- a/scripts/capture.sh +++ b/scripts/capture.sh @@ -1,11 +1,11 @@ #!/bin/bash -# +# CAPTURE source ./conf.sh DEVICE="/dev/video0" -GOPT=" -v -s 1920x1080 -p 0 -n 30" +GOPT=" -v -s 1920x1080 -p 0 -n 10" OUTD=$GRABDIR TMPG="/dev/shm/tmpgrab.fimg" @@ -15,9 +15,13 @@ do # take the picz ${GRAB} -d ${DEVICE} ${GOPT} -o ${TMPG} + # display $TMPG + # only take the good spot fimg=$(printf "%s/%05d.fimg" ${OUTD} ${idx}) - ${EXTR} ${TMPG} 800,600,560,240 ${fimg} + ${EXTR} -o ${fimg} ${TMPG} 800,600,560,240 ${fimg} + + # display ${fimg} ; exit echo sleep $DELAY_GRAB diff --git a/scripts/conf.sh b/scripts/conf.sh index 5145705..f67639d 100644 --- a/scripts/conf.sh +++ b/scripts/conf.sh @@ -1,4 +1,6 @@ +# Sat Jul 8 10:41:58 UTC 2023 + # # location of some tools # @@ -6,14 +8,15 @@ GRAB="$HOME/Devel/FloatImg/v4l2/grabvidseq" MKFX="$HOME/Devel/FloatImg/tools/fimgfx" MDAT="$HOME/Devel/FloatImg/tools/fimgmetadata" -EXTR="fimgextract" +EXTR="$HOME/Devel/FloatImg/tools/fimgextract" + INTERPOLATOR="$HOME/Devel/FloatImg/Fonderie/interpolator" FONDERIE="$HOME/Devel/FloatImg/Fonderie/fonderie" SINGLEPASS="$HOME/Devel/FloatImg/Fonderie/singlepass" NBPASS=2400 -DELAY_GRAB=3 +DELAY_GRAB=1 IDXLINKFARM=0 # diff --git a/tools/fimgextract.c b/tools/fimgextract.c index 6271a97..99e360c 100644 --- a/tools/fimgextract.c +++ b/tools/fimgextract.c @@ -68,7 +68,7 @@ printf("-- Fimg Extractor -- lib v%d -- %s %s\n", FIMG_VERSION, puts("usage:\n\tfimgextract [options] source.fimg width,height,xpos,ypos"); puts("options:"); puts("\t-o out.fimg\tname the output file"); -puts("\t-v\t\tmake be a blabla box"); +puts("\t-v\t\tmake me a blabla box"); puts("\t-x\t\tenable crashy feature"); exit(0); } @@ -92,9 +92,11 @@ while ((opt = getopt(argc, argv, "ho:vx")) != -1) { } } -fprintf(stderr, "argc = %d optind = %d\n", argc, optind); -for (idx=optind; idx %d\n", argv[0], foo); exit(1); } -foo = extractor(argv[argc-2], output_file, &area); +foo = extractor(argv[optind], output_file, &area); if (foo) { fprintf(stderr, "%s: extractor --> %d\n", __func__, foo); exit(1);