This page contains descriptions and links to miscellaneous scripts that I've written. For scripts that I use to manage files, see FS Tools.
Table of Contents
FLAC to OGG Converter (flac2ogg.pl)
This script converts FLAC audio files to OGG Vorbis while preserving the tag information. Input FLAC filenames are sent to STDIN, and ".flac" is changed to ".ogg" for the output filename. Output files that already exist are skipped to prevent data loss.
At this time, the only way to change the options for OGG encoding
is to manually edit the script (which is fairly easy). The default
is "oggenc -Q -b 256 -m 64 -M 350 ..."
This script uses the Audio::FLAC::Header Perl module.
See below for installation instructions.
Example 1 - Convert a few tracks
cd /music/Artist/Album /bin/ls -1 *.flac | perl /path/to/flac2ogg.pl
Example 2 - Recursively convert FLACs
cd /music/ find . -type f -iname \*.flac -print | perl /path/to/flac2ogg.pl
Notes for All Scripts
You can run the scripts without any options to see what options are available. If there are none, nothing will be displayed.
Installing Perl Modules
If you get errors about not being able to run a script due to missing Perl modules,
you can look at the top few lines of the script for lines in the form:
use Foo::Bar; and install them, using the following command:
perl -MCPAN -e 'install Foo::Bar'
In FreeBSD, Perl modules can often be installed via the ports tree:
portinstall p5-Foo-Bar
No Warranty
NOTE THAT WHILE I HAVE TAKEN CARE TO MAKE SURE THAT THESE SCRIPTS ARE SAFE, I CANNOT GUARANTEE THAT THEY WON'T CAUSE PROBLEMS, INCLUDING DATA LOSS. USE AT YOUR OWN RISK. If you see errors about uninitialised variables, or similar, that is a bug. It may or may not be harmless. It is best to only run these scripts on directories whose contents are "pristine," that is, ones whose contents all have the necessary permissions, and no special files such as pipes or character devices.
Please contact me if you have problems or patches.