I forgot the awk file
here it is
---- goes.awk ---
BEGIN { x="" }
// {
if ( x != $5 ) { print $0 }
x = $5
}
On 11/1/24 13:15, American Citizen wrote:
To all:
I decided to create a bash script to automate the making of mp4 videos
from the GOES full disk loops. I found that the Mozilla Firefox cache
gets filled with 1808x1808 jpeg files, around 240, and then the java
scripts loops over these in the animation display. (not the animated gif)
To create the full disk mp4, I clear the cache first, then reload the
full disk animated loop with 240 frames. It will take 2-3 mins for the
cache to be fully loaded. Once the loop takes off, I halt the loop
using the pause button at the top, then relocate the picture using the
slide bar at the bottom pushing it to the utmost left.
Then I kick off this script and in about 49 secs to 70 secs, I get a
very nice mp4 video. This is much faster than waiting for dozens of
minutes or an hour or two on the build animated gif command which
seems to fail for the 240 image loop sequence.
The bash script is listed below, in case you want to try it out on
your linux machine. In making these mp4 videos, I discovered that
sometimes not all 240 frames are in the cache area, so I go with what
I have.
----------- make-GOES-video.sh -----------
tag=`date +"%Y-%m-%d %H:%M:%S.%N" | md5sum | cut -c1-32`
strt=`date +"%s"`
echo "This bash script only works for GOES-R full disk jpeg files
1808x1808 pixels in size"
bld="/home/owner/Desktop/tmp"
if [ ! -d $bld ] ; then
mkdir $bld
fi
## Cleanup temporary processing folder
cd $bld
ls * | sed "s/^/rm /" > tmp000.$tag
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/*
.
## Reject bad files
ls * | sed "s/^/identify /" > tmp000.$tag
bash tmp000.$tag > tmp001.$tag 2>&1
## Particular GOES-1[6-9] Full Disk jpegs only
grep "JPEG 1808x1808" 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"
exit