flac2ogg.py :: FLAC to Ogg Vorbis Converter
Overview
If you're like me, you store valuable audio content in a compressed, lossless format whenever possible, right? I use FLAC.
For many playback situations, the FLAC format is perfectly acceptable. However, there are circumstances when it's more appropriate to put a smaller file size and less CPU-intensive audio format on a portable device (even if FLAC is supported).
flac2ogg.py: What Does It Do?
Of course it transcodes a FLAC file to an Ogg Vorbis file; that's no big deal. So why this script?
- Convert an entire directory of *.flac files to ogg format with a single command.
- All the FLAC files' meta data are carried over to the new ogg files.
Documentation
From the command line:
$ flac2ogg.py --help
Usage: flac2ogg.py [options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-d FLAC_DIR Set full path (with or without trailing slash)
to flac directory: $ flac2ogg.py -d /music/bartok/concertos/
Current directory is used if -d switch omitted
-b BITRATE Specify ogg file bitrate encoding: $ flac2ogg.py -b 128
Default bitrate is 256 if -b switch omitted
Examples
Convert a single directory of flac files into ogg format at default bitrate of 256kbs:
$ flac2ogg.py -d /music/Stereolab/MargerineEclipse/
Convert a directory of flac files into ogg format at 128kbs:
$ flac2ogg.py -b 128 -d /music/Stravinsky/Petrouchka/
Converted ogg files are created in the current directory.
Download
flac2ogg.py_v1.1.tar.gz
md5sum: 87b2987ae7a566d33205ada47049dd32
Put the extracted flac2ogg.py file in your path and make it executable.
Requirements
flac2ogg.py stands on the shoulders of giants:
- Linux & Python
- FLAC command line tools:
sudo apt-get install flac - Ogg Vorbis tools:
sudo apt-get install vorbis-tools - mutagen:
sudo apt-get install python-mutagen - tagpy:
sudo apt-get install python-tagpy
You can enhance and improve flac2ogg.py at the GitHub repository.
Addendum
flac2mp3.py will be forthcoming.
Send comments and suggestion to user gold at this site's domain.