ImportDVD.sh

From MythTV Official Wiki
Revision as of 00:50, 4 June 2012 by NigelPearson (talk | contribs) (Hacky script for importing DVD tracks into TV recordings)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Important.png Note: The correct title of this article is importDVD.sh. It appears incorrectly here due to technical restrictions.


Author Nigel Pearson
Description Adds previously MythArchived tracks to new recordings, for creating new DVDs
Supports Version21.png  


This tacky shell script was created as an extra menu item in MythArchive. It sort of does the opposite of Archiving TV recordings. My wife uses it to create new DVD compilations from previously created DVDs. e.g. a new science TV programme on earthworms is recorded, so she imports old clips about green waste processing or composting, and MythArchives them all out onto a new disc.

This was for an old KnoppMyth machine that had been upgraded to 0.21. Current myth.rebuilddatabase.pl probably behaves very differently.

#!/bin/sh

cd /myth/tv

dvdunauthor /dev/hdc
eject       /dev/hdc

# We now have files like:
#
# dvdauthor.xml    vob_01m_004.vob  vob_01m_009.vob  vob_01t_005.vob
# vob_00m_001.vob  vob_01m_005.vob  vob_01t_001.vob  vob_01t_006.vob
# vob_01m_001.vob  vob_01m_006.vob  vob_01t_002.vob  vob_01t_007.vob
# vob_01m_002.vob  vob_01m_007.vob  vob_01t_003.vob
# vob_01m_003.vob  vob_01m_008.vob  vob_01t_004.vob
#
# We only care about the titles.

rm -f dvdauthor.xml vob_*m_*.vob
sleep 10

# Script to drive the prompts in myth.rebuilddatabase.pl:
echo 'y

DVD import





n
' > /tmp/importDVD.txt



# Insert as recordings:
for i in *.vob
do mv $i $i.mpeg2
   myth.rebuilddatabase.pl -f $i.mpeg2 --dir /myth/tv < /tmp/importDVD.txt
done

rm /tmp/importDVD.txt
sleep 5

# Fix the seektable.
#
# The 'mythcommflag  --rebuild' in myth.rebuilddatabase.pl doesn't
# seem to work on these files, so we have to do it differently.
#
# Filename prefix has now changed, so to fix seektable,
# we dumbly process all recent files with the suffix.


#for i in *.mpeg2
#do mythtranscode -m -b -i $i
#done

find . -name \*.mpeg2 -cmin -90 -print -exec mythtranscode -m -b -i {} \;


rm -f /myth/tv/*.mpeg2.tmp

}}