Others > General

HD-Aufnahmen verteilen und archivieren

<< < (2/3) > >>

kuro13:
@woody
Blöde Frage: Schaust du dir diese vielen Aufnahmen auch einmal an... oder ist das der "will haben" Effekt?
Bei mir war das vor Jahren das rippen von DVD... die ich letztendlich nie angesehen habe... nun funktionieren sie nicht mehr... macht aber nichts. :)

woody:
Das frage ich (und meine Frau übrigens auch) mich auch manchmal. Du hast recht. Es ist der Sammler-Effekt: "Jetzt hab ich den Film mal, ansehen kann ich ihn mir ja immer noch..." :-)

woody:
Hallo zusammen,

ich habe mich nun doch dazu entschieden, einen neuen Weg für die Archivierung der Aufnahmen zu gehen: Ich benenne die Dateien nach dem für Kodi gut lesbaren Schema "Filmtitel (Jahr).ts" um, ohne sie neu zu kodieren. Kodi erkennt den Film und holt die weiteren Infos mit seinem Media-Scraper aus dem Internet. Dazu habe ich mir folgendes Script erstellt:


--- Code: ---#!/bin/sh
   
#/usr/bin/rename

# Für alle zur Zeit noch nicht zum Löschen vorgesehen Aufzeichnungsordner ...
recpath="$(find /mnt/data -path *.rec)"

find /mnt/data -path *.rec | while read line; do
# ... mache Folgendes:

# Wechsle in das von find übergebene Verzeichnis
cd "${line}"
echo "${line}"
# Entnimm den Filmtitel aus der Info-Datei
title="$(grep  ^T info | sed -e 's/^T //g' -e 's/|/\n/g')"
# Entnimm das Herstellungsjahr aus der Info-Datei und klammere es ein
year="$(grep  ^S info | sed -r -e 's/[a-zA-Z ,;]*//g' -e 's/[0-9]+/(&)/')"
# Erzeuge den neuen Dateinamen
name="${title} ${year}.ts"
echo "Stelle ${name} zur Verfügung. Das kann etwas dauern..."
# Speichere die zusammengefügte TS-Datei im neuen Verzeichnis
# Falls 00002.ts und 00003.ts (je max. 9999MB) nicht existieren, gibt es eine Fehlermeldung,
# aber das Script läuft weiter
cat 00001.ts 00002.ts 00003.ts> "/mnt/data/finished/${name}"

done
--- End code ---

Das Script starte ich über das OSD mit der /etc/vdr/menu.xml


--- Code: ---            <menu name="Recordings">
                <command name="Aufnahmen fertigstellen" execute="/usr/bin/rename" />
            </menu>
           

--- End code ---

Das Ergebnis sieht dann so aus:


--- Code: ---mld> ls -h /mnt/data/finished
300 (2006).ts
EuroTrip (2004).ts
Flug durch die Hölle (1990).ts
Knight and Day (2010).ts
Maze Runner - Die Auserwählten im Labyrinth -(2014).ts
Running Scared (2006).ts

--- End code ---

woody:
Ich habe das Script noch etwas optimiert und würde es gerne der VDR-Community zur Verfügung stellen. Es wäre gut, wenn ein Profi nochmal drüberschauen würde, ob ich alle formalen Kriterien eingehalten habe. Ich bin für jede Rückmeldung dankbar.

Hier das Skript:


--- Code: ---#!/bin/sh
   
#/usr/bin/finishforkodi

# This script scans "indir" for vdr-recording-subdirs with already cut, but not for deletion marked movies and glues all ts-files
# there together to one file. This file is renamed to "Title-of-the-movie (year).ts" so that Kodi can recognize the file
# properly and so collect additional info and fanart from the internet. At last the script moves all finished files to "outdir"
# for further processing e.g. by Handbrake or for simply viewing them.
#
# "indir" and "outdir" can be defined by editing the following two lines:

indir="/mnt/data/"
outdir="/mnt/data/finished/"

# Do not edit behind this line.

find ${indir} -path *%*.rec | while read line; do
cd "${line}"
echo "Preparing file in ${line}"
title="$(grep  ^T info | sed -e 's/^T //g' -e 's/[.:]//g' -e 's/|/\n/g')"
year="$(grep  ^S info | sed -r -e 's/[^0-9]*//g' -e 's/[0-9]+/(&)/')"
name="${title} ${year}.ts"
echo "Finishing ${name} ..."
test -e "${outdir}${name}" && rm -f "${outdir}${name}"
for tsfile in $(find -name "0000[0-9].ts" | sort); do
                   cat "${tsfile}" >> "${outdir}${name}"
done
done
--- End code ---

woody:
Hier die aktuelle Version des Skriptes, nun mit log-Ausgabe...


--- Code: ---#!/bin/sh
   
#/usr/bin/finishforkodi

# This script scans "indir" for vdr-recording-subdirs with already cut, but not for deletion marked movies and glues all ts-files
# there together to one file. This file is renamed to "Title(year).ts" so that Kodi, Plex or other scrapers can recognize the file
# properly and collect additional info and fanart from the internet. At last the script moves all finished files to "outdir"
# for further processing e.g. by Handbrake or for simply viewing them. :-)
#
# "indir" and "outdir" can be defined by editing the following two lines:

indir="/mnt/data/tv/"
outdir="/mnt/data/finished/"

# --- Do not edit behind this line. ---

find ${indir} -path *%*.rec | while read line; do
cd "${line}"
title="$(grep  ^T info | sed -e 's/^T //g' -e 's/[.:]//g' -e 's/|/\n/g')"
year="$(grep  ^S info | sed -r -e 's/[^0-9]*//g' -e 's/[0-9]+/(&)/')"
name="${title} ${year}.ts"
echo "Concatenating '${name}'"
test -e "${outdir}${name}" && rm -f "${outdir}${name}"
   for tsfile in $(find -name "0000[0-9].ts" | sort); do
                      cat "${tsfile}" >> "${outdir}${name}"
   done
cd ..
test -e "${line}" && rm -rf "${line}"
find ${indir} -type d -empty -delete
date -R|tr '\n' ' '>> ${indir}finishforkodi.log; echo "Movie '${name}' successfully renamed and concatenated." >> ${indir}finishforkodi.log
done
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version