To all:
I updated the attached bash script so it can handle any size frames,
when a user looks at an animation from the NOAA Weather Bureau such as
https://www.star.nesdis.noaa.gov/goes/floater_band.php?stormid=AL182024&band=EXTENT3&length=24
All this requires, is that you clear the browser cache, then load up the
NOAA animation, then halt it. Then run the bash script. You need to make
sure that the cache location is correct for your install, but that is
done (on Mozilla Firefox) by opening up the "about/cache" webpage in the
browser.
This careful loading up of the complete animation is to ensure that the
cache has all the jpeg files loaded up.
Then simply run the attached bash script.
(spelled out in this email)
-------------------- start snipping here ----------------------------
tag=`date +"%Y-%m-%d %H:%M:%S.%N" | md5sum | cut -c1-32`
strt=`date +"%s"`
root="/home/owner/Desktop"
bld=$root/tmp
if [ ! -d $bld ] ; then
mkdir $bld
fi
## Cleanup temporary processing folder
cd $bld
ls * 2>/dev/null | sed "s/^/rm /" > tmp000.$tag 2>/dev/null
bash tmp000.$tag
## Grab all stored Mozilla Firefox cache found by the about:cache
command in the browser URL bar
cp
/home/owner/.cache/mozilla/firefox/w0y9ffsl.default-release-1/cache2/entries/*
.
## Locate true size of frames
ls * | sed "s/^/identify /" > tmp000.$tag
bash tmp000.$tag > tmp001.$tag 2>&1
size=`cat tmp001.$tag | cut -c47-55 | sort | uniq -c | sed "s/^ *//" |
sort -k1,1n | tail -1 | cut -f2 -d" "`
echo "Frame size: $size pixels"
## Particular GOES-1[6-9] Full Disk jpegs only
grep "$size" tmp001.$tag > tmp002.$tag
cut -f1 -d" " tmp002.$tag > tmp003.$tag
## Find server timestamps and sort in temporal order YR Month Hr:Min
cat tmp003.$tag | sed "s/^/grep -a LABEL /" | sed "s/$/ | cut -c1-82/" >
tmp004.$tag
bash tmp004.$tag > tmp005.$tag
paste tmp003.$tag tmp005.$tag | tr "\t" " " | sort -k4,4n -k3,3M -k5,5 >
tmp006.$tag
## reject duplicates and rename sequentially as jpeg files
gawk -f /home/owner/goes.awk < tmp006.$tag > tmp007.$tag
cut -f1 -d" " tmp007.$tag > tmp008.$tag
sz=`cat tmp008.$tag | wc -l`
sz=`expr $sz + 1000`
seq 1001 $sz | sed "s/$/.jpeg/" | sed "s/^1//" > tmp009.$tag
paste tmp008.$tag tmp009.$tag | sed "s/^/mv /" | tr "\t" " " > tmp010.$tag
bash tmp010.$tag
szz=`cat tmp010.$tag | wc -l`
## create mp4 file
lbl=`head -1 tmp006.$tag | cut -c51-91 | tr ": /" "__" | sed "s/$/.mp4/"`
ffmpeg -framerate 10 -i %3d.jpeg -c:v libx264 -r 5 $lbl > /dev/null
2>/dev/null
cat tmp000.$tag | sed "s/identify/rm/" > tmp011.$tag
bash tmp011.$tag 2>/dev/null
## cleanup and post stats and mp4 file name and processing time
rm *.jpeg
rm tmp*.$tag
echo "Found $szz frames:"
echo "final: $lbl"
stp=`date +"%s"`
elap=`echo "$stp - $strt" | gp -q`
echo "time: $elap secs"
mv $bld/*mp4 $root
nm=`ls $root/*mp4`
echo "Video: $nm"
exit
----------- end snip for bash script ---------