18
TV Tubes Talkin’ ‘bout my automation… (Complete with crappy PowerPoint theme) (Complete with crappy PowerPoint theme) Neil Crosby Neil Crosby

TV Tubes - Talkin' 'bout my automation

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: TV Tubes - Talkin' 'bout my automation

TV TubesTalkin’ ‘bout my automation…

(Complete with crappy PowerPoint theme)(Complete with crappy PowerPoint theme)Neil CrosbyNeil Crosby

Page 2: TV Tubes - Talkin' 'bout my automation

The Problem

You:

• Like watching TV Shows.

• Can’t watch when they’re on TV normally.

• Don’t have a VCR.

Page 3: TV Tubes - Talkin' 'bout my automation

The Solution

• Timeshift by downloading episodes.

• Put episodes into iTunes.

• Sync to iPod, iPhone, TV etc.

• Delete them once they’ve been watched.

• But, do this completely automatically.

Page 4: TV Tubes - Talkin' 'bout my automation

What You Need

• A Mac

• TVShows.app

• BitTorrent Client

• VisualHub

• iTunes

• Two FolderActions

• One Standalone AppleScript

• A Small Aubergine

Page 5: TV Tubes - Talkin' 'bout my automation

TVShows.app

• Lets you download new episodes of shows whenever they appear, automatically.

• Whenever new episodes appear, they get downloaded by your favourite BitTorrent client.

• It’s a kind of magic

Page 6: TV Tubes - Talkin' 'bout my automation

BitTorrent

• Any client will do, as long as fully downloaded items are able to be moved to a “downloaded” folder automatically.

• Azureus does this quite happily.

Page 7: TV Tubes - Talkin' 'bout my automation

The First FolderAction

• Invoked when files appear in “downloaded” folder.

• Starts VisualHub using a config file.

• Pipes files into VisualHub.

• Starts VisualHub re-encoding the files.

Page 8: TV Tubes - Talkin' 'bout my automation

VisualHub

• Costs $23.32

• Uses ffmpeg for encoding.

• So, it could (and should) be refactored out as an exercise for the reader

Page 9: TV Tubes - Talkin' 'bout my automation

ffmpeg commandlineffmpeg -y -threads 4 -i some.show.03x05.some.episode.name.avi -s 640x480 -r 29.98 -vcodec h264 -g 300 -aspect 640:480 -qmin 27 -b 900 -level 30 -loop 1 -sc_threshold 40 -partp4x4 1 -rc_eq 'blurCplx^(1-qComp)' -refs 2 -qmax 51 -maxrate 1400 -async 50 -acodec aac -ar 44100 -ac 2 -ab 128 some.show.03x05.some.episode.name.mp4

Page 10: TV Tubes - Talkin' 'bout my automation

VisualHub

• Costs $23.32

• Uses ffmpeg for encoding.

• So, it could (and should) be refactored out as an exercise for the reader

• Set up to save re-encoded to episodes to “encoded” folder.

Page 11: TV Tubes - Talkin' 'bout my automation

The Second FolderAction

• Invoked when files appear in “encoded” folder.

• Adds files to iTunes

• Works out Show Name, Season Number and Episode Number (Perl)

Page 12: TV Tubes - Talkin' 'bout my automation

The Perl

if (/^(.*)[\s\.\-]+s?([0-9][0-9]?)[ex]?([0-9][0-9])/i) {

$show=$1; $season=$2; $episode=$3; $show=~s/\s*-\s*$//; // Remove dash from end of show name $show=~s/\./ /g; // Convert dots to spaces $show=~s/((^\w)|(\s\w))/\U$1/g; // Capitalise each word print "$show\n$season\n$episode\n";

}

Show Season Episode

Page 13: TV Tubes - Talkin' 'bout my automation

The Second FolderAction

• Invoked when files appear in “encoded” folder.

• Adds files to iTunes

• Works out Show Name, Season Number and Episode Number (Perl)

• Sets info in iTunes

Page 14: TV Tubes - Talkin' 'bout my automation

iTunes

• Does any syncing that you’ve told it to do with your TV Shows!

• You get to watch the shows you want without having to be around when they’re on TV.

• Awesome.

Page 15: TV Tubes - Talkin' 'bout my automation

The Overall Process

Page 16: TV Tubes - Talkin' 'bout my automation

But wait, there’s more!

Page 17: TV Tubes - Talkin' 'bout my automation

Current Gotchas

• Deletion process still to be written.

• VisualHub can’t cope with videos inside folders.

• VisualHub doesn’t like things to be added to its “to encode” list - shows get encoded twice.

Page 18: TV Tubes - Talkin' 'bout my automation

Write-up / Instructions

• Full instructions for setting up your own “TV Tubes” process will be available at workingwith.me.uk very soon.