If your data is in a external library, you can do this on the file in the library. After that you have to select it and do the following:
Refresh encoded videos
Refresh metadata
Refresh thumbnails
#!/bin/bash
#set -x
if [ "$#" -lt 2 ]; then
echo >&2 'fix filename 90||-90||0'
exit 1
fi
fix=0
exiftool $1 | grep "^Create Date" | grep 0000 && fix=1
dater=$(realpath $1| grep -oE '[0-9]{8}' | head -1 )
if [ $2 == "90" ] ; then
ffmpeg -i $1 -vf 'transpose=1' -c:a copy tmp_${1}
mv tmp_${1} $1
fi
if [ $2 == "-90" ] ; then
ffmpeg -i $1 -vf 'transpose=2' -c:a copy tmp_${1}
mv tmp_${1} $1
fi
if [ $fix == "1" ] ; then
echo "Fixing date"
touch -t ${dater}1200.00 $1
fi
Get location of file by pressing the (i)
Deinterlace video and touch date, when no exif date is embedded
#!/bin/bash
mkdir -p deinterlace
for video in DV*; do
[ -f "$video" ] || continue
: >2.log
echo "testing $video"
ffmpeg -i "$video" -filter:v idet -frames:v 500 -an -f rawvideo -y /dev/null 2>2.log
inter=$(
grep Parsed 2.log |
tail -2 |
cut -d: -f2- |
awk '
{
inter += $2 + $4
prog += $6
}
END {
print (inter > prog ? 1 : 0)
}'
)
if [ "$inter" -eq 1 ]; then
echo "convert $video"
ffmpeg -i "$video" -vf bwdif -c:v libx264 -crf 18 -preset medium \
-c:a aac -b:a 192k "deinterlace/${video%.*}-deinterlaced.mp4"
fi
dt=$(echo "$video" | grep -oE '[0-9]{2}-[0-9]{2}-[0-9]{2}_[0-9]{2}-[0-9]{2}' | tr '_' ' ' | tr '-' ' ')
if [ -n "$dt" ]; then
# convert DD-MM-YY HH-MM to YYYY-MM-DD HH:MM
read year month day hour minute <<< "$dt"
# assume 20xx for year
year=$((2000 + year))
touch -d "$year-$month-$day $hour:$minute:00" "deinterlace/${video%.*}-deinterlaced.mp4"
touch -d "$year-$month-$day $hour:$minute:00" "$video"
fi
done
FIX DATES FILES in /2006/20060701/ structure
This touches files which have no exif info, to the date of the directory to that date with time 12:00
find . -type f -iname "*.mpg" | while read -r file; do ymd=$(echo "$file" | grep -oE '[0-9]{8}' | head -1); touch -t "${ymd}1200.00" "$file"; done
Touch date of current directory to date in path
for f in *; do
[[ $f =~ ([0-9]{8}) ]] || continue
touch -t "${BASH_REMATCH[1]}1200.00" "$f"
done
Broken thumb nail fix
# goto movie file in your library
# Add flags using below command
ffmpeg -i 73a1a221be4c.mp4 -c copy -video_track_timescale 90000 -movflags +faststart output.mp4
# replace movie file
cat output.mp4 > 73a1a221be4c.mp4
rm output.mp4
# then fresh encoded videos in immich, then refresh metadata and thumbnails.
FIX Date unknown or incorrect dates
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <movie-file> <YYYYMMDD>"
exit 1
fi
FILE="$1"
DATE="$2"
# Validate date format
if [[ ! "$DATE" =~ ^[0-9]{8}$ ]]; then
echo "Error: date must be YYYYMMDD"
exit 1
fi
# Convert YYYYMMDD -> YYYY:MM:DD 12:00:00 for EXIF metadata
YEAR="${DATE:0:4}"
MONTH="${DATE:4:2}"
DAY="${DATE:6:2}"
EXIFDATE="${YEAR}:${MONTH}:${DAY} 12:00:00"
# touch format: YYYYMMDD1200.00
TOUCHDATE="${DATE}1200.00"
echo "File: $FILE"
echo "Date: $DATE"
echo "Metadata: $EXIFDATE"
echo "Filesystem: $TOUCHDATE"
# Change movie metadata dates
exiftool -overwrite_original \
"-CreateDate=$EXIFDATE" \
"-ModifyDate=$EXIFDATE" \
"-TrackCreateDate=$EXIFDATE" \
"-TrackModifyDate=$EXIFDATE" \
"-MediaCreateDate=$EXIFDATE" \
"-MediaModifyDate=$EXIFDATE" \
"$FILE"
if [ $? -ne 0 ]; then
echo "Error: exiftool failed"
exit 1
fi
# Change filesystem timestamps
touch -t "$TOUCHDATE" "$FILE"
if [ $? -ne 0 ]; then
echo "Error: touch failed"
exit 1
fi
Pen holder in above post was GCODE controlled, but I lost it somewhere. Now not needed because i’ve got a bedslinger 3D printer with Z axis instead of using a X/Y lasercutter frame.
Using Inkscape and OpenScad (to design a pen holder see below)
In Inkscape you need the Gcodetool extention
Multi color !!
UPDATE:
Some text writing using Hershey fonts.
Below a python script to move X/Y in the GCODE
#!/usr/bin/env python3
import re
import sys
OFFSET_X = 40.0
OFFSET_Y = 80.0
def shift_gcode(input_file, output_file):
coord_re = re.compile(r'([XY])([-+]?\d*\.?\d+)')
with open(input_file, "r", encoding="utf-8", errors="ignore") as f:
lines = f.readlines()
with open(output_file, "w", encoding="utf-8") as f:
for line in lines:
def replace_coord(match):
axis = match.group(1)
value = float(match.group(2))
if axis == "X":
value += OFFSET_X
elif axis == "Y":
value += OFFSET_Y
if value.is_integer():
value = int(value)
return f"{axis}{value}"
line = coord_re.sub(replace_coord, line)
f.write(line)
if __name__ == "__main__":
if len(sys.argv) != 3:
print(f"Usage: {sys.argv[0]} input.gcode output.gcode")
sys.exit(1)
shift_gcode(sys.argv[1], sys.argv[2])
print(f"Shifted X/Y by {OFFSET_X} x {OFFSET_Y} mm: {sys.argv[1]} -> {sys.argv[2]}")
Browsing though secondhand shops, and retro art shops, I came across a cool old piece of history.
I was planning to remove the internals (first checking if its really broken .. it is), and make a radio which plays audio fragments from the 50-60s. (Music and News)
Playing old media using a raspberry
Using the original knobs and lights (more on this later)
While tuning in on channels, static sound will be heard and country selection will be a used also for music/news selection
Maybe I’ll use one of the turning knobs as decade selector (like the old band selector 25m/31m etc)
Back of the radio
Type H265A01. This one was made in de 50s in Nederlandsche Seintoestellen Fabriek (N.S.F.). This factory was standing within 100 meters where I currently live
Another interesting thing: It has a Magic Eye (Philips MiniWatt EM4)! This little thingy works like a mini CRT device.
A magic eye EM4 is a vintage vacuum tube (introduced around 1938–1939) used as a visual tuning indicator in old European radios and test equipment. It glows with a green or yellow-green phosphor pattern that narrows or expands based on signal strength, helping users find the exact radio frequency
Due too the high voltages needed for this device, I’ll be storing this in a safe place, and make a modern alternative using a microcontroller and a round display.
Our Onkyo was giving problems, some channels are breaking up. To have some channels back, we needed to crank up the volume for a few seconds.
So I thought .. preamps!
So I opened the Onkyo and started investigating.
We used it as a 5.1 surround sound system. So I’ve got PreAmp channels to spare, so lets switch the boards!
Well, that didn’t work. Reading forums, it COULD be the sound chip, on the main board. Because of the heat over the years, it could losing contact with the main PCB.
So I put my heatgun to work, but to no avail. One of the square chips on the right in first photo.
The AMP being 15+ years old, we decided to get a new one. Researching best amp’s in 2026 … in our price range.
Onkyo TX-RZ50
Amazing …
Using the DIRAC sound setup, perfect again.
Using the same IP, our Home Assistant setup mostly worked without changing much.
"If something is worth doing, it's worth overdoing."