initial commit of bin scripts into git

This commit is contained in:
2023-11-08 13:38:19 +11:00
commit 3735eea3c6
113 changed files with 11631 additions and 0 deletions

33
convert_myth_vid_to_plex Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/bash
ids=$(echo -n "select intid from videometadata where filename like 'Local%'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n+2)
echo $ids
for id in $ids;
do
title=$(echo -n "select title from videometadata where intid = '$id'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n1)
subtitle=$(echo -n "select subtitle from videometadata where intid = '$id'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n1)
description=$(echo -n "select plot from videometadata where intid = '$id'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n1)
filename=$(echo -n "select filename from videometadata where intid = '$id'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n1)
date=$(echo -n "select insertdate from videometadata where intid = '$id'" | mysql --host=mara.ddp.net --user=mythtv --password=mythtv mythconverg 2>&1 | grep -v 'Using a password' | tail -n1)
echo "processing ($filename) -- $id: $title ($sub_title): $plot"
if [ x"$subtitle" != x"" ]; then
title="$title: $subtitle"
fi
input_filename="/myth/videos/$filename"
input_basename=`basename $input_filename`
input_base="${input_basename%.*}"
category="localtv"
echo "ffmpeg -i $input_filename -codec copy -metadata title=\"$title\" -metadata description=\"$description\" -metadata album=\"$category\" -metadata date=\"$date\" /myth/opt/storage/other-videos/Local\ TV/$input_base.mp4"
if [ ! -f /myth/opt/storage/other-videos/Local\ TV/$year/$input_base.mp4 ]
then
ffmpeg -i $input_filename -codec copy -metadata title="$title" -metadata description="$description" -metadata album="$category" -metadata date="$date" /myth/opt/storage/other-videos/Local\ TV/$input_base.mp4
else
echo "Skip: /myth/opt/storage/other-videos/Local\ TV/$input_base.mp4 -- Already exists!"
fi
done