First attempt of a working script

Lacks sanity & dependency tests. Dependency-test should be made first before
anything else is started.

Transcoding optimizations TBD:

* Ability to skip finalizing into ISO & always keep temp-files regardless of
  -k flag. This would save about 5 minutes on a total of about 20 minutes.

* Use "get main feature only" ability in dvdbackup instead of figuring out
  which files to use. This makes sense when final result is not an iso but a
  transcoded file. The current solution is safer for "broken" disks, but
  slower. Hard to say how much this would save in the long-run because many
  disks nowadays are broken. But in best case 1/2 time of the 15 minuets it takes
  to read the disk.

In all, these two optimizations have the potential to save about the same
amount of time which it takes to html5 compatible transcode. I.e.
dist-to-iso or disk-to-mp4 HD-res should take about the same time, about
25-30 minuts.

Lets go slow first.

Change-Id: I45dd7e5dc946e3ab50d74688182de476ed3cd1e7
ISO9660-2 enforced

Final ISO should now be playable by most players

* Directory structure is enforced
* All names should be uppercase. genisoimage created an image that when
  mounted had all lower. Either a intentional error to mark it's result
  unplayable, or a consequence of not following standard per default.
* UDF compliant file-system (i.e. sorting, padding)

Bugfix

Change-Id: Idc59201a2bea20f6b929e1c6610b8dc404dde233
rbot.sh added

Automates process making console obsolete after start.

Minor fix in toiso making automating process able to continue even if
previous run failed.

TBD:
* Make it daemonizeable

Change-Id: Id084fcf9ea0a3dae5b247a51137ebd42b28a637d
Various improvements

Cycling round in "bot-mode" now works. An alternative more sexy way of doing
is is described here:

http://arstechnica.com/civis/viewtopic.php?f=16&t=1137975

I believe this solution to be more robust however.

Change-Id: Ic2f3960852ff2adceab7959d9a78fff7402df9d3
Transcoding

First part done.

* Will select feature
* Runs authoring

Result is playable but still DVD format. Subtitles are still there, but
looks like shit (black on black)

Change-Id: I7225ee6c34ecb09b0f9bc3964b5d021f34be4e71
Interface to transcoder added

ffmpeg interface added. Just plain old missionary so far. I.e. no fancy
analyze. Subs are most likely lost now.

Todo:
* Complete man-pages. None are complete except toiso.sh's, they just look
  nice and don't break anything...

* Transcode from *.iso

* Tidy up temp-files

* Tune tune tune...

Change-Id: Ic83b49ac759377b84fb39d6a258b48eb8e4573b0
set -o pipefail

Should make "set -e" catch even errors in pipe. Not sure about sub-shells.

Change-Id: Iaa425f3a393343b7a4d62a02462815f34cfbb96a
Added ability to skip authoring step.

In some cases authoring isn't needed, but authoring itself is buggy. Added
flag -T (as in Trust Time) to skip authoring step and transcode directly from
original.

Change-Id: Ib368b5c6029b4c9165f83c8b622c8040b2b8a43c
Added generalized error handling.

Inspired by:

http://www.linuxjournal.com/content/use-bash-trap-statement-cleanup-temporary-files

Change-Id: Ifee076dbf167102c1a3d7f5d84eceecca4bba627
Transcodes now also directly from iso's

Two modes available, selectable via option -M
* Mounted. Could be faster if system is favourable but require authorization
  (sudo in script). I.e. hard to subscript. Therefore the next one is made
  default instead:
* dvdcopy with flag -F. This gets the main feature only, but as we do that
  already it's not really needed. The main reason is that dvdcopy doesn't
  require mounting.

Works fair, but I obviously still haven't understood transcoding correctly
as the default settings I pass to dvdauthor still produce spoken language
Spanish for one of my DVD:s.

One hypothesis is that the options (if they do anything at all) just change the
numbering for each container. That would explain why the default settings for
--video make dvdauthor to croak for the same problematic movie.

Change-Id: Ieb4e4f7782828569d50fc895a872a598182e48d7
More tolerant to errors when used in loop

In loops like the following:

for F in $(find "$ORG_DIR" -type f | sort); do
	echo $F;dvd.tc.sh -t "$DST_DIR" "$F";  mv $F
	"$ORG_DIR/../$(basename $F)"; done

When one job failed, most often in dvdauthor, it would make all the
following fail too.

Bugfix

Change-Id: If66a6e3fce790ef3668bf0cceae51e5d8fee42dc