TIP MythTV to iPod

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

MythTV Series Myth TV


Installation


Tips/Tweaking


Usage


edit

[edit] Problem

You're eating dinner by yourself again, and you're bored out of your mind. Boy wouldn't it be nice if you had that South Park you recorded last night on your iPod so you do something while waiting for them to burn your food?

[edit] Setup

Required tools:

ffmpeg (use flag)
nuvexport
mythtv
AtomicParsley

Emerge the required tools. Once they are installed, nuvexport needs to be configured

For nuvexport 0.5 copy .mythtv/config.xml to /etc/mythtv/.mythtv/config.xml Then create this config file and place it in the home directory

File: ~/nuvexportrc.xml
 
<mp4>
    vbr		    = yes
    mulitpass	    = no
    quantisation    = 4
    crop	    = yes
    use_cutlist	    = no
    noise_reduction = no
    deinterlace	    = yes
    a_bitrate	    = 128
</mp4>
  

su to your mythtv user and create the following script in the home directory.

File: ~/nuvencode.sh
 
#!/bin/bash
HOST=192.168.0.1
DB=mythconverg
USERNAME=mythtv
PASSWORD=mythtv
SAVEPATH="/videos/ipod"

MYSQLCMD="mysql $DB -h $HOST --skip-column-names -B -u $USERNAME --password=$PASSWORD"
NUVCMD="/usr/bin/nuvexport --noconfirm --mode=mp4 --infile=$1 --nice=8 --path=SAVEPATH --config=~/nuvexportrc.xml --filename=$1"
echo Running \"$NUVCMD\" 

echo "" | $NUVCMD 2>/dev/null 1>/dev/null

# Load the db entries
TITLE=`echo "select recorded.title from recorded where basename='$1';" | $MYSQLCMD`
SUBTITLE=`echo "select recorded.subtitle from recorded where basename='$1';" | $MYSQLCMD`
DESCRIPTION=`echo "select recorded.description from recorded where basename='$1';" | $MYSQLCMD`
EPID=`echo "select syndicatedepisodenumber from recordedprogram, recorded where \
recorded.programid = recordedprogram.programid AND recorded.starttime = recordedprogram.starttime \
AND basename='$1';" | $MYSQLCMD`

# Work around files which may already exist with the same name
FILENAME="$SAVEPATH/$TITLE - $SUBTITLE.mp4"
if [ -e "$FILENAME" ] ; then
        COUNTER=2
        FILENAME="$SAVEPATH/$TITLE - $SUBTITLE.$COUNTER.mp4"
        while [ -e "$FILENAME" ]; do
                let COUNTER=COUNTER+1
                FILENAME="$SAVEPATH/$TITLE - $SUBTITLE.$COUNTER.mp4"
        done
fi
echo AtomicParsley $SAVEPATH/$1.mp4 --stik "TV Show" --TVShowName "$TITLE" --TVEpisode "$SUBTITLE" \
--description "$DESCRIPTION" --TVEpisodeNum "$EPID" -o "$FILENAME"
AtomicParsley $SAVEPATH/$1.mp4 --stik "TV Show" --TVShowName "$TITLE" --TVEpisode "$SUBTITLE" \
--description "$DESCRIPTION" --TVEpisodeNum "$EPID" -o "$FILENAME"
rm $SAVEPATH/$1.mp4
  

Setup mythtv to use handle this user job

Use mythtv-setup to add a user job:
 ~/nuvencode.sh %FILE%

[edit] How to Use It

Load your cut points and adjust them as need be
Use a lossless transcoder to remove these portions of the recording
Run your new user job
Load the recording on your iPod and go

If this has helped you, please say so on the discussion page. I want to know if this writeup is really helpful or a waste of my time.

Personal tools