usage and examples

sneetchalizer command line flags/options:

General options:

-h or --help
Print quick or full usage details respectively.
-r or --recursive
Search directory arguments recursively for files to convert.
-d or --delete
delete input files after successful conversion. May not be safe yet!!!
-v or --verbose
makes sneetchalizer more chatty.
-s or --show-output
shows output from conversion tool.
-p or --pretend
don't convert anything. sneetchalizer will go through the motions and print out the commands it would run. Useful for preview- ing a complex command line to ensure it does what you intend. You should interpret this option's output with a grain of salt. For example, if you include the '--sanitize' option, the files will not really be renamed when using --pretend, and as such the command's output will not reflect that the filenames would be changed during an actual run.
-t or --terminate
terminate sneetchalizer options. This is useful if you have to convert '--coolDir' or '-groovySong.mp3'. This is the only option whose order on the command line is significant.
-D ARG or --out-directory=ARG
write all outfiles to a directory argument. This is useful if you want to (re)encode files directly to a mounted portable device.
--strict and --pedantic
many errors that sneetchalizer may encounter are recoverable, such as specifying a directory as argument that contains no files to convert, or conversion failures in general. By default the script will print an error message and move on to the next file. If you use '--strict' then sneetchalizer will bail out at the first sign of trouble except for tag errors. With '--pedantic' the script will stop even on tag errors.
Preserve timestamp (mtime) of original file.
--threads [N]
Experimental. Use threads to create concurrent jobs. This option takes an optional integer argument which represents the number of threads to launch. The default is two. Preliminary tests suggest there is little advantage (and even diminishing returns) when setting this number greater than the number of cores/CPUs you have. Due to the asychronous nature of threads the --verbose and --show-output flags will be silently disabled and most screen output is supressed.
Removes ,, ;, :, ', ", %, @, #, and ` from filenames and tags.
-n [FORMAT] or --rename[=FORMAT]
rename all outfiles (and temporary wavs) according to FORMAT. FORMAT is a string with special designators to be pulled from the file tags. The following options are available:

* %t Song title
* %b Album title
* %n Track number
* %a Artist name
* %y Year
* %g Genre
* %c Comment field

Directories may be created with this command, as in "%b/%n - %t". The default value of FORMAT is "%n %t".

Bitrate/Quality/Compression options:

-b or --bitrate
mp3/ogg/m4a bitrate.
-q or --quality
mp3/ogg quality.

quality and bitrate are passed directly to lame or oggenc depending on mp3 or ogg output format respectively. Both tools can handle either a bitrate or quality argument, so it is important to understand what values are valid for the underlying tool in your specific use case. faac will accept a bitrate argument, but not a quality argument. These options will be silently ignored for any output formats other than mp3, ogg or m4a. Make sure you know what you are doing if you decide to use both in one run, and read each tools manpage for valid values. If these options are omitted the tools builtin defaults are used (-q3 for oggenc and -q5 for lame).

-c or --compression
flac/mac compression level.

this option allows you to pass a compression argument to flac and mac. See 'flac --help' and/or 'mac --help' if you don't know what this means.

Format Options:

output format. Default is wav.
input format(s). Default is wav.

Valid output formats are: "aac", "aif", "aifc", "aiff", "aiffc", "ape", "au", "cdr", "cdda", "copy", "flac", "m4a", "m4b", "mpc", "mp4", "mpp", "mp3", "mp2", "ofr", "ofs", "ogg", "snd", "spx", "tta", "wav", "wv". Valid input formats are all of the above plus "wma". You can specify multiple input formats using a comma: 'mp3,m4a,wma'. Input format is only neccesary when passing directory arguments, as file arguments are handled by context (read: file extension). The "copy" output option copies files directly, bypassing decoding/encoding steps (useful in conjunction with --rename).

Tagging Options:

--tt or --title
Set 'title' tag.
--ta or --artist
Set 'artist' tag.
--tl or --album
Set 'album' tag.
--ty or --year
Set 'year' tag.
--tc or --comment
Set 'comment' tag.
--tg or --genre
Set 'genre' tag.
--tn or --trackn
Set 'track number' tag.

The short and long versions are different in an important way: Using the long version will clobber any existing tags. The short version will only set the tag if the existing tag has no value. Note that these tags will be placed in _every_ outfile during the run.

Alternative Encoder/Decoder Options:

use gogo to encode mp3 files.
use bladeenc to encode mp3 files.

The default is still 'lame'. If 'lame' is not found, the script will search for one of these two encoders regardless if these options are passed or not.

Special Options:

add ARG to infile conversion command. Possibly dangerous!
add ARG to outfile conversion command. Possibly dangerous!

These two options are a hook to pass additional options to the underlying conversion tools. ARG is passed directly to the shell (right after the command name) so escape it if neccesary. The underlying tool will depend on input and output format, for example, if --in is ogg and --out is mp3 then --in-optionhook's value would get passed to oggdec and --out-optionhook's value would be passed to lame. Using these options are at your own risk, and bug reports involving them will be ignored.
Example usage:

$ sneetchalizer song.mp3

The most simple possible example, creates 'song.wav'.

$ sneetchalizer --out=ogg --in=flac -q5 /some/music/dir

This example converts every flac file in '/some/music/dir' to ogg format at quality 5.

$ sneetchalizer -d --out=mp3 --in=ogg,m4a,wma -b 160 .

Converts every ogg, m4a, and wma file in the current directory to a 160 kbps constant bitrate mp3 file. The original files are deleted.

$ sneetchalizer --out=mp3 --out-optionhook="--preset extreme" /some/wavs

Here we encode every wav in '/some/wavs' to mp3 format passing '--preset extreme' directly to lame.

$ sneetchalizer --in=ogg --out=ogg --quality=1 norvegianWood.ogg /some/more/oggs

Using the same --in and --out format allows us to resample/encode the file at a different bitrate or quality. Note that this will overwrite the original file so only do this on a copy, or use '-D' to write files to another directory.

$ sneetchalizer --in=ogg --out=m4a -D /mnt/ipod/ /some/oggs

Here we re-encode some ogg files to m4a format and write them to our mounted iPod.


このページは、ossanが2011年2月14日 18:45に書いたブログ記事です。