1MP3c and batch-files
2--------------------
3
4MP3c has two different modes: an interactive mode, where you can use the
5menu-environment to do what you want, and the non-interactive mode (also called
6batch-mode), where only a shell script for automatic encoding is created.
7
8You can create batch-files in both modes.
91) In interactive-mode press F5 or '5' to open a directory-requester where the
10batch-file should stored. Select the destination-directory, press F1 and then
11enter the filename you want to use. Voila, your script-file is created. The
12advantage in interactive-mode is that your current settings would be used. So
13you can first enter all data in the correct way, and select the tracks you
14want to encode (in non-interactive mode, all tracks would be used).
15
162) In non-interactive mode you start MP3c with -b option, followed by the
17filename for your new script:
18>[ws1ls@excelsior src]$ ./mp3c -b mp3c-batch1
19>WSPse MP3c - Batchmode, noninteractive
20>reading config
21>loading configuration
22>configuration loaded
23>reading TOC of cd
24>building up data tree
25>lookup CDDB entry
26>look in local CDDB
27>building shellscript
28>ready...
29
30Furthermore you can add the following options:
31-i <config-file>, to define another config-file from default.
32-d <cdrom-device>, to define another cdrom-device.
33
34New in version 0.20 is the option:
35-t <temp-dir>, to define where ripped files should be stored before encoding.
36This Option overwrites tmp-directory definition from config-file.
37
38The batch/script-files:
39-----------------------
40MP3c V0.19 (and older versions) created script-files without any options, they
41would only do for what they were created. With V0.20 this files are totally
42different.
43While creation of the new script-files, MP3c does not look for the settings of
44"on-the-fly encoding flags" and "rip first, before encoding" any longer.
45The magic is now in the script-files itself.
46
47You can see all available options, if you call the script with "-h" parameter:
48>[ws1ls@excelsior src]$ ~/mp3c-batch1 -h
49>
50>Available options for this script:
51>-1: rip tracks only and exit
52>-2: only encode (tracks must be already ripped for this)
53>-3: create mp3's on the fly
54>-a <order>: rip and encode by <order> (default)
55>  order = 0: encode track directly after ripping
56>  order = 1: first rip all tracks and then start encoding (default)
57>-v: activate verbose mode
58>-O: disable STDOUT from external programs
59>-o: enable STDOUT (default)
60>-E: disable STDERR (default)
61>-e: enable STDERR
62>-V: show script-version information
63>-h: this help
64
65Well, let us look at the different options:
66The first thing is the verbosity of the script. Normally there is a great
67overhead from ripper and encoder-program, particularly if on-the-fly encoding
68is used. You have the possibility to control the stdout and stderr-messages
69separately. By default the script would show the output from stdout, but hide
70all output coming from stderr. You can control this with the options -o, -O,
71-e and -E. In most cases it makes sense to use "-O -E" to ignore any output.
72Well, not only the external programs want to talk, also the script itself. You
73can use the "-v" option to switch the script into the verbosity modus. It will
74then tell you which track is ripped or encoded, in generally whats going on.
75I think it is a great deal to use "-v -O -E", so you have only a small, but
76informative output (great if used from cron-jobs, etc).
77
78Now to the interesting part of the script-modi:
79-1: If you use this option, the cd is read and each track is ripped (and saved
80    into the the temp-dir). After this, the script will exit.
81-2: This is the option you should use, after running the script with "-1",
82    because it will encode the temp-files, set mp3-id tags and updates the
83    m3u-playlistfile. After all tracks are ready, the script exits.
84-3: If you use this option, all tracks will be encoded in on-the-fly modus.
85
86If you plan to encode one cd by another, there are two further modes:
87-a 1: All tracks will be ripped and then encoded. This is like calling the
88      script two times, first with "-1" and then with "-2". You see "-a 1" is
89      a short form for this, without existing after ripping the cd.
90-a 0: This mode would do the same like "-a 1", but you don't need so much
91      memory on your hard disk, because encoding is done after a track is
92      ripped.
93
94Rip more than one cd before encoding
95------------------------------------
96So, this is easily done, with these new batch-files (with a newer version it
97will be possible to do this even in interactive-mode).
98First create batch-files for your cds you want to encode, and start each
99script-file with "-1" (hope you have enough disk space ;-). After you ripped
100all the cds, you can start the script-files with "-2".
101
102Lets say you want to encode 3 cds:
103a) insert first cd and type:
104     mp3c -b batch1 && ./batch1 -1 -v -O -E
105b) change cd now, and insert the second one:
106     mp3c -b batch2 && ./batch2 -1 -v -O -E
107c) so, now your tmp-directory is full, but you have the partition /mnt/part2
108   with some more diskspace. So insert the third cd:
109     mp3c -b batch3 -t /mnt/part2/ && ./batch3 -1 -v -O -E
110
111At this moment all tracks are ripped and sit safely on your harddisk (so
112you give the cds back to your friends, eh ;-). Since encoding takes a lot of
113CPU-cyles you might want to do this over night. No problem at all. Just type
114this, before going to bed:
115     ./batch1 -2 -v -O -E && ./batch2 -2 -v -O -E && ./batch3 -2 -v -O -E
116And in the next morning (if you have a fast CPU ;-) all your new mp3-files are
117ready.
118
119Matthias Hensler, WSPse, 8/1999 (written)
120Matthias Hensler, WSPse, 3/2000 (updated)
121