Git Product home page Git Product logo

transcode's Introduction

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.

transcode's People

Contributors

jeffayle avatar

Stargazers

Nick Kampe avatar  avatar

Watchers

 avatar

transcode's Issues

Transcode all

shell script to transcode all files in the current directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.