Use Python version of Jpegize as a preparation

This commit is contained in:
Pavel Machek
2024-05-04 23:45:51 +02:00
parent 00f40b52df
commit 950d11fd96
2 changed files with 9 additions and 44 deletions

View File

@@ -7,45 +7,6 @@ jpegize() {
DNG_DIR="$1"
BURST_DIR="$GIGA_DIR/sm/"
mkdir $BURST_DIR
DCRAW=dcraw
TIFF_EXT="tiff"
set --
CONVERT="convert"
cd $DNG_DIR
I=0
NUM=0
for DNG in *.dng; do
NUM=$[$NUM+1]
done
for DNG in *.dng; do
PERC=$[(50*$I)/$NUM]
echo Message: ${PERC}%
BASE=${DNG%%.dng}
# -w Use camera white balance
# +M use embedded color matrix
# -H 2 Recover highlights by blending them
# -o 1 Output in sRGB colorspace
# -q 0 Debayer with fast bi-linear interpolation
# -f Interpolate RGGB as four colors
# -T Output TIFF
(
$DCRAW -w +M -H 2 -o 1 -q 0 -f -T "$DNG"
$CONVERT "$BASE.tiff" "$BASE.jpeg"
rm "$BASE.tiff"
mv "$BASE.jpeg" "$BURST_DIR/$BASE.jpeg.sv"
) &
# dcraw -h -> half size -- fast!
# can do ppm output
I=$[$I+1]
if [ 0 == $[ $I % 16 ] ]; then
echo "Batch $I -- $PERC %" 1>&2
wait
fi
done
}
SCRIPT_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
@@ -66,7 +27,9 @@ if [ "-$1" == "-start" ]; then
elif [ "-$1" == "-stop" ]; then
mkdir $GIGA_DIR/sm
kill `cat $2/audio.pid`
jpegize $2 # | zenity --progress "--text=Converting, phase 1, dng -> jpeg" --time-remaining
cd $GIGA_DIR
echo Message: Jp
@LIBEXECDIR@/mpegize.py jpegize $GIGA_DIR/ $FPS
echo Message: Mp
cd $GIGA_DIR/sm
@LIBEXECDIR@/mpegize.py convertall $GIGA_DIR/ $FPS