ANDREW

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
USAGE
FILES
ENVIRONMENT
DIAGNOSTICS
AUTHOR
SEE ALSO

NAME

andrew.sh − create AVI, Matroska, MP4 or OGM files from DVDs

SYNOPSIS

andrew.sh [-d file] [-i source] [-I mode] [-1 name] [-2 title[,chapter[,chapter]]] [-3 answer] [-4 value] [-w mode] [-p mode] [-o destination] [-H mode] [-c container] [-m mode] [-s size] [-A mode] [-q quality] [-g volume] [-t tracks] [-l language[,language...]] [-S mode] [-T tracks] [-L language[,language...]] [-D directory] [-v encoding] [-f option[:option...]] [-X option[:option...]] [-x option[:option...]] [-k seconds] [-z mode] [-r mode] [-ChV]

DESCRIPTION

andrew.sh is Not a DVD Ripping and Encoding Wizard.

In fact it is a command-line interface that simplifies the use of some applications to create AVI, Matroska, MP4 or OGM files from DVDs.

OPTIONS

-d file

Use the specified configuration file instead of the file ~/.andrew.conf.

-i source

Use the specified source instead of the one in the configuration file. Paths of DVD devices, DVD ISO images and directories containing DVD rips are allowed. To rip your DVD you can use andrew.sh itself or vobcopy(1): type ’vobcopy -m -i’ followed by the mount point of your DVD device.

-I mode

Use the specified input mode instead of the one in the configuration file. Allowed modes are batch (non-interactive) and interactive. You can invoke andrew.sh in non-interactive mode inside a for loop to encode all the titles of your TV series DVD or to batch process some DVD previously ripped.

-1 name

Set input mode to batch and use the specified name for your movie. If the name contains "*/:<>?\| characters, andrew.sh will strip them off; if it’s longer than 155 bytes, andrew.sh will name your movie automatically.

-2 title,chapter,chapter

Set input mode to batch and encode the whole specified DVD title or only the part between the two specified chapters. If the title is not valid, andrew.sh will encode the longest title; if the first chapter is not valid, andrew.sh will encode the whole title; if the second chapter is not valid, andrew.sh will encode only one chapter.

-3 answer

Set input mode to batch and answer as specified to whether the video is totally or mostly interlaced. If the answer is not y (yes) nor n (no), andrew.sh will consider the video non-interlaced.

-4 value

Set input mode to batch and use the specified value as number of parts, bit rate in kbit/s or file size in MiB, depending on the mode to create files. If the value you specified is not valid, andrew.sh will use the maximum allowed value.

-w mode

Use the specified working mode instead of the one in the configuration file. Allowed modes are fly (on-the-fly encoding) and rip (before encoding, andrew.sh will copy the whole DVD into rips subdirectory under its working directory ). You can rip DVDs only if vobcopy(1) is installed. If there is already a rip of your DVD in rips subdirectory or the specified source is a directory, andrew.sh will change rip into fly.

-o destination

Use the specified destination directory for AVI, Matroska, MP4 or OGM files instead of the one in the configuration file. If the specified destination directory does not exist or you aren’t allowed to write in it or there isn’t enough available disc space on the partition where it is, AVI, Matroska, MP4 or OGM files will be moved in the directory where andrew.sh will have created its working directory. If the destination directory contains already files with the same name of new AVI, Matroska, MP4 or OGM files, numbered backups of the old files will be made.

-p mode

Use the specified cleaning mode instead of the one in the configuration file. Allowed modes are all (both the DVD rip and temporary files will be removed at the end of the encoding), none (nothing will be removed) and tmp (only temporary files will be removed). In any case andrew.sh will remove the DVD rip only if it was created during its last session.

-H mode

Use the specified compatibility mode instead of the one in the configuration file. Allowed modes are cheap (cheap or old stand-alone DivX/MPEG-4 players), ipod (iPod Classic from 5G 1.2, Nano from 3G, Touch and iPhone) and none. If you specify a mode other than none, andrew.sh will override some options in order to create files compatible with the devices which they intended to be played on.

-c container

Use the specified container format instead of the one in the configuration file. Allowed formats are avi (AVI), mkv (Matroska), mp4 (MP4) and ogm (OGM). You can create MP4 or OGM files only if MP4Box(1) or ogmmerge(1) is installed. If there is no AC-3 audio track in your DVD and lame(1) is not installed, andrew.sh will change avi into mkv.

-m mode

Use the specified mode to create files instead of the one in the configuration file. Allowed modes are cd (one or more files of the size you can specify with -s option), kbps (a single file with the video bit rate you will specify) and mb (a single file of the size you will specify). If the minimum number of parts is more than your DVD chapters or your DVD contains a single chapter or the maximum size is smaller than the size of a part or some parts are too short to be encoded with good results, andrew.sh will change cd into mb. This option is ignored when you are using constant quality VBR method for the video.

-s size

Use the specified size in MiB of a part instead of the one in the configuration file. Allowed values are integers between 1 and 1024 MiB. It refers to cd mode to create files.

-A mode

Use the specified audio selection mode instead of the one in the configuration file. Allowed modes are auto (andrew.sh will decide on the basis of the configuration file and the arguments of the options -a, -t and -l) and manual (andrew.sh will show you a summary of DVD audio tracks followed by some questions). If input mode is batch or if there is only one audio track, container format is avi and lame(1) is not installed, andrew.sh will change manual into auto.

-q quality

Use the specified audio quality instead of the one in the configuration file. Allowed values are numbers between 0 (highest quality encoding) and 5 (lowest quality encoding) and ac3 (AC-3 extraction). If you specify a value other than ac3, andrew.sh will encode audio to AAC, if container format is mp4 and faac(1) is installed, MP3, if container format is avi and lame(1) is installed, or Vorbis, if container format is mkv or ogm. If container format is mp4, andrew.sh will change ac3 into 2. This option acts only as default when audio selection mode is manual.

-g volume

Use the specified audio volume gain, instead of the one in the configuration file. Allowed values are norm (normalisation) and integers between 0 (filter inactivated) and 60 dB.

-t tracks

Use the specified maximum number of audio tracks instead of the one in the configuration file. Allowed values are integers between 1 and 8. You can use only one AC-3 audio track in AVI files; you can’t use more than one audio track in AVI files without installing avimerge(1). This option acts only as default when audio selection mode is manual.

-l language,...

Use the specified languages for audio tracks instead of the ones in the configuration file. Allowed values are all (no language preference) or a coma-separated list of two small letter ISO 639-1 codes listed by the option -C, in decreasing order of preference. The list has to contain the languages allowed in the audio tracks of your AVI, Matroska, MP4 or OGM files: if a language is missing from your DVD, it will be substituted by another one of your list until your list is over or your AVI, Matroska, MP4 or OGM files contain the maximum number of audio tracks you specified. You can repeat the same code to encode more than one audio track with that language code; if none of the specified languages is found, only one audio track containing the first language of your DVD will be encoded; DVD audio tracks with invalid language codes will be ignored, but if you have no language preference and the language code of a track isn’t valid, andrew.sh will ask you to specify the code. This option acts only as default when audio selection mode is manual.

-S mode

Use the specified subtitle selection mode instead of the one in the configuration file. Allowed modes are auto (andrew.sh will decide on the basis of the configuration file and the arguments of the options -T and -L) and manual (andrew.sh will show you a summary of DVD subtitle tracks followed by some questions). If input mode is batch or there is no subtitle track or there is only one, andrew.sh will change manual into auto.

-T tracks

Use the specified maximum number of subtitle tracks instead of the one in the configuration file. Allowed values are integers between 0 (no subtitle track) and 32 and hard (one hard-encoded subtitle track). You can use more one or more soft-encoded subtitle track only in Matroska and MP4 files. This option acts only as default when subtitle selection mode is manual.

-L language,...

Use the specified languages for subtitle tracks instead of the ones in the configuration file. Allowed values are all (no language preference) or a coma-separated list of two small letter ISO 639-1 codes listed by the option -C, in decreasing order of preference. The list has to contain the languages allowed in the subtitle tracks of your AVI, Matroska, MP4 or OGM files: if a language is missing both from your SRT directory and from your DVD, it will be substituted by another one of your list until your list is over or your AVI, Matroska, MP4 or OGM files contain the maximum number of subtitle tracks you specified. You can repeat the same code to encode more than one subtitle track with that language code; SRT will take precedence over VobSub subtitle tracks; Vobsub subtitle tracks with invalid language codes will be ignored, but if you have no language preference and the language code of a track isn’t valid, andrew.sh will ask you to specify the code. This option acts only as default when subtitle selection mode is manual.

-D directory

Use the specified SRT subtitle files directory. The SRT subtitle files must UTF-8 encoded and named xy.srt, where xy is a valid two small letter ISO 639-1 code listed by the option -C, and the subtitle timings have to be suited to the frame rate and relative to the whole DVD title where your movie is, even if you want to encode few chapters only.

-v encoding

Use the specified video encoding instead of the one in the configuration file. Allowed encodings are fmp4 (the codec from FFmpeg libavcodec compliant with MPEG-4 ASP standard), xvid (XviD codec, compliant with MPEG-4 ASP standard) and x264 (x264 codec, compliant with H.264/MPEG-4 AVC standard). You can use XviD or x264 codec only if mencoder(1) was compiled with XviD or x264 support.

-f options

Use the specified FMP4 encoding options instead of the ones in the configuration file. Allowed options are the lavcopts specified by mplayer(1) except the following ones: acodec, abitrate, aspect, autoaspect, bit_exac, keyint, ildc, ilme, lmin, lmax, mbqmin, mbqmax, qpel, vbitrate, vcodec, vqmax, vqmin, vpass, vratetol, vrc_maxrate, vrc_minrate, vrc_override. For animations better use mbd=2:trell:cbp:v4mv:precmp=1:cmp=1:subcmp=1. To take advantages of your dual-processor or dual-core system add :threads=2. If you specify vqscale=<0-31>, andrew.sh will encode FMP4 video using constant quality VBR method, which makes target file size and needed disk space estimation impossible; otherwise it will encode using two-pass ABR method.

-X options

Use the specified XviD encoding options instead of the ones in the configuration file. Allowed options are the xvidencopts specified by mplayer(1) except the following ones: 4mv, aspect, autoaspect, bitrate, container_frame_overhead, interlacing, max_bquant, max_iquant, max_key_interval, max_pquant, min_bquant, min_iquant, min_key_interval, min_pquant, mod_quant, pass, qpel, quant_range, zones. For animations add :cartoon. If you specify fixed_quant=<1-31>, andrew.sh will encode XviD video using constant quality VBR method, which makes target file size and needed disk space estimation impossible; otherwise it will encode using two-pass ABR method.

-x options

Use the specified x264 encoding options instead of the ones in the configuration file. Allowed options are the x264encopts specified by mplayer(1) except the following ones: bitrate, keyint, keyint_min, interlaced, pass, qp, qp_min, qp_max, qp_step, ratetol, vbv_maxrate, vbv_bufsize, vbv_init, zones. If you specify crf=<1-50>, andrew.sh will encode x264 video using constant quality VBR method, which makes target file size and needed disk space estimation impossible; otherwise it will encode using two-pass ABR method.

-k seconds

Use the specified seconds per key frame instead of the ones in the configuration file. Allowed values are integers between 0 (every frame will be a key frame) and 10. Low values entail low video quality, high values inaccurate searching.

-z mode

Use the specified mode to deal with interlaced videos instead of the one in the configuration file. Allowed modes are hard (deinterlacing before encoding) and soft (encoding in interlaced form). Encoding in interlaced form will preserve quality for watching the video on TV, but you will need to deinterlace the video on-the-fly when you watch it on your computer monitor.

-r mode

Use the specified video resolution selection mode instead of the one in the configuration file. Allowed modes are auto (scaling on the bit per pixel per frame), bpp (scaling on the bit per pixel per frame you will specify), full (no scaling, just cropping), max (scaling to the highest allowed horizontal resolution) and multiples of 16 between 320 and 640 (scaling to the horizontal resolution specified). If input mode is batch, andrew.sh will change bpp into auto; if you are you are using constant quality VBR method for the video or your DVD is low-resolution, andrew.sh will change bpp and auto into max.

-C

List ISO 639-1 and 639-2/T codes for representation of languages and exit (with success).

-h

Display the help and exit (with success).

-V

Output version information and exit (with success).

USAGE

After having been invoked in interactive mode, andrew.sh demands simply that you reply the asked questions. There are some answers that cause a special behaviour:

w

Display the sections of the GNU General Public Licence about warranty.

c

Display the GNU General Public Licence from section 1.

h

Display further explanations about the asked question.

q

Quit.

Before starting to encode, andrew.sh shows you a summary. Text styles and colours have different meanings:

bold

Values from your configuration file or from command line options.

blue

Values from your answers.

green

Estimated values.

At the end of its job andrew.sh shows you some information, in particular the mean quantizer with its standard deviation and the overhead, the ratio between the AVI, Matroska, MP4 or OGM file size and the data size.

FILES

~/.andrew.conf

Configuration file. It’s created at the first start.

ENVIRONMENT

LC_MESSAGE variable determines andrew.sh language. If the relative translation doesn’t exist, andrew.sh language will be English.

PWD variable determines where andrew.sh will create its working directory. If you aren’t allowed to write in the current directory, andrew.sh will create its working directory in your HOME directory.

If andrew.sh working directory is on a filesystem that doesn’t support named pipes, Vorbis or MP3 audio encoding will not be on-the-fly, but first a raw PCM audio track will be encoded.

DIAGNOSTICS

The following exit state are returned because of errors displayed on stderr:

64

The option is not allowed by andrew.sh or misses its argument or the argument is not allowed by the option.

69

The listed programs are missing in the path specified by PATH variable or you aren’t allowed to execute them.

70

andrew.sh was terminated by SIGINT or SIGTERM.

AUTHOR

Alessandro Di Rubbo

SEE ALSO

mplayer(1).