Encoding Vorbis files in Linux using oggenc for your own music collection and HTML 5

Introduction



In today's topic, I will be showing readers different ways you can encode your music collection, if you just moved over to Linux from Windows using open source codecs! You do not have to encode your music files with Vorbis, due to the fact that MP3 is also supported in Linux and HTML 5, but there are some substantial benefits to doing in this day and age (at least from the perspective of an open-source nerd 8-)). The first is you don't have to worry about royalty's and licensing rates (especially if you are opening up a store for indie musicians). The second is that both objectively and subjectively Vorbis sounds substantially better and has been greatly improved with the help of dedicated "audiophiles" and the open source community, since it's first public release over a decade ago, way back in 2002. Today, I will show you some tips and tricks if you are new to encoding your music collection in Linux using the oggenc command-line program in Linux (This tutorial will not be geared towards Windows, because most of the time you will be doing batch encoding with an external program and using it's GUI, so it will not be necessary to use the command-line windows encoder).

Note: If you do NOT want to encode all of your files on the command-line, I recommend you do a search for Rubyripper 0.5.7 or the newer 0.6.0 branch, especially if you are running Ubuntu/Fedora! It's a secure ripper that does batch encoding on the fly and you can encode to MP3, Vorbis, and FLAC natively [1]. Most package managers and different Linux distro's, include it by default now.

Let's get started with some personal examples that I use to encode my music collection and one's that popular music service Spotify (C) uses! please note that each of these example requires that you know how to navigate and use command-line terminal in Linux. The term ABX, refers to a double-blind listening test (you don't need to perform them on your own and you can just use these settings by default, but if you are STILL not convinced and do not trust your ears do a search over on Hydrogenaudio.org to determine your absolute threshold of hearing using several tools written for Windows, OS/X, and Linux. You may want to consider performing an ABX test for "artifacts" that may pop up from time to time with your hearing as well!).

Most Vorbis users "recommended" settings for your music collection



First example: Encoding a series of PCM (WAV) stereo files to a -q 6 (~192 KB/sec) streams in Vorbis using "point stereo" channel coupling (This level is usually somewhat difficult to "ABX", but artifacts will "pop up" from time to time. It's the BEST trade off between quality and space).


$oggenc -q 6 /home/USR/Music/*.wav -o /home/USR/Music/*.ogg

My "recommended" settings for your music collection



Second example: Encoding a series of PCM (WAV) stereo files to a -q 8 (~256 KB/sec) streams in Vorbis using NO channel coupling (It's impossible for "me" to ABX at this level) [1]

$oggenc -q 8 /home/USR/Music/*.wav -o /home/USR/Music/*.ogg

Spotify default setting using Vorbis streaming in the cloud



Third example: Encoding a series of PCM (WAV) stereo files to a -q 5 (~160 KB/sec) streams in Vorbis using "point stereo" channel coupling (a good trade-off between quality and space for streaming) [1]

Spotify © "free" music account settings (by default)

$oggenc -q 5 /home/USR/Music/*.wav -o /home/USR/Music/*.ogg

Fourth example: Encoding a series of PCM (WAV) stereo files to a -q 9 (~320 KB/sec) streams in Vorbis using NO channel coupling (overkill in my opinion) [1]

Spotify © "premium" music account settings (using high quality mode)

$oggenc -q 9 /home/USR/Music/*.wav -o /home/USR/Music/*.ogg

That about covers it! If you have any more questions or need to know the best trade-off between quality and space, or how to ABX even, please use the references that I have provided below for a wiki page that I helped co-author [1]! I hope in some way, I have convinced you to start encoding with Vorbis for HTML 5 and your own collection in Linux! If you have any questions, do not hesitate to contact me or leave me comments. I will be back in a couple of days, with another entry. Take care and have a lovely Thanksgiving next week, if you are one of my U.S readers!


Reference:



1. Hydrogenaudio Wiki. "Recommended Ogg Vorbis"
http://wiki.hydrogenaudio.org/index.php?title=Recommended_Ogg_Vorbis#Recommended_Encoder_Settings accessed 19 Dec 2011. 21 Nov 2011.




Comments

Popular posts from this blog

Encoding Opus files in Linux with opusenc for your own collection and HTML 5

Transcoding H.264 files to Google's WebM format (VP8/Vorbis) in FFMPEG 0.6 or better using Linux for your own collection and HTML 5