Skip to content

jeffayle/Transcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Transcode - ImageMagick inspired audio transcoding

When you need to convert images between formats, it's as easy as

convert input.png output.jpg

Thanks to ImageMagick. Unfortunately, it is much more difficult to do the same with audio.

flac -c -d input.flac | lame -V 0 - output.mp3

Will do the same thing for audio (where png is now flac, and jpeg is now mp3). This will not take care of metadata (artist, title, album, et cetera), and uses different switches for each codec, which you would have to look up each time, or try to memorize. It's evident that this is not a usable solution.

Transcode is a simple cli application written in python designed to easily transcode between audio codecs. The above example becomes as simple as

transcode input.flac -V 0 output.mp3

That's it, you even keep your metadata!

Usage

transcode <input file> [options] <output file>

The output format is determined by its extension. Options affect how the file is encoded, for example, with mp3 you can add -V 0 to encode with the highest VBR settings.

If output file is only an extension (ie. .mp3) it will be given the same file name as the input, with the new extension. For example, transcode something.wv -V 0 .mp3 will make a V2 mp3 named something.mp3.

Installation

Installation is taken care of by distutils, to install just run python setup.py install, and everything will just work.

Dependencies

Required

Optional (for differenct codecs)

Supported Codecs

For Encoding

  • flac
  • mp3
  • wavpack
  • Ogg Vorbis
  • Speex

For Decoding

  • flac
  • mp3
  • wave (No metadata support)
  • wavpack
  • Ogg Vorbis
  • Speex (No metadata support)

Quick Command Line Option Reference

Unless otherwise noted, command line options are sent directly to the encoder, so any options for that encoder should work.

Here is a quick reference of commonly used options for each supported encoder.

Flac

-0 through -8

Compression level. -0 sets no compression, -8 sets highest compression.

MP3

-V (0  through 9)

Use VBR compression. -V 0 is the highest quality, -V 9 is the lowest.

-b n

Use CBR encoding. n is the bitrate in kb/s to use, and can be 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 or 320

WavPack

-bn

Use lossy compression. n is the bitrate to target. If this can be achieved with lossless compression, it will encode losslessly.

-c

Create a correction file if lossy. The lossy .wv file can be used on its own, but will be lossless if accompanied by the .wvc file this switch creates.

Ogg Vorbis

-q (-1 through 10)

Set the encoder quality. -1 is lowest, 10 is highest, 3 is default. Fractional values can also be given.

Speex

-n, -w, -u

Narrowband (8kHz), wideband (16kHz) and ultra wideband (32kHz) respectively.

--quality (0 through 10)

Set the encoding quality. 0 is lowest, 10 is highest, 3 is default.

About

ImageMagick inspired command line program for transcoding audio

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages