Вы находитесь на странице: 1из 4

Audio formats: lossy and lossless.

Lossy formats throw out audio information when encoding to lower the file size of the song so no lossy format is technically CD quality. However, perceivable quality is more important and lossy formats can provide audio that is indistinguishable from the original CD. Lossless formats work like Zip files. It compresses your audio as much as it can without throwing out any audio information. When the losslessly compressed file is decompressed it will have the same quality it had before it was compressed. In other words, lossless formats retain the CD quality audio on your CDs. There is no quality loss. The bit rate of a file is the data rate that the audio is compressed at. There is no clear answer to which is best, it all depends on your hearing. Do some comparison tests between the CD quality audio and encoded files at various bit rates and determine which sounds best to you. Bit rates are used in the following ways: CBR (constant bit rate) - The file is encoded using the same bit rate throughout the entire file. VBR (variable bit rate) - The bit rate changes throughout the file according to the complexity of the music to offer the best quality. ABR (average bit rate) - This is a simple VBR mode where the bit rate fluctuates through out the song and averages out to be a certain bit rate. MP3 is by far the most popular audio format in use today. It was the first lossy compression codec which means it is also the oldest lossy compression format. MP3 can achieve transparent, or indistinguishable from CD, quality at around 192kbps-256kbps to most people on most samples. The LAME encoder is highly recommended when encoding MP3s by the folks at Hydrogenaudio.org. It is the highest quality MP3 encoder available. If you are concerned about compatibility with software and portable audio players then this is the format to use. AAC or Advanced Audio Coding, is a relatively new format. AAC has been made popular by Apple because of its integration into Apple's iTunes music software and its iPod portable audio player. At any bit rate, AAC should sound better than MP3. Likewise, a 128 kbps AAC file should sound better than a 128 kbps MP3 file. AAC is gaining popularity and so it is becoming compatible with more media players but currently the iPod is the only major portable audio device that can playback MPEG-4 AAC. Note that AAC is not owned by Apple. It is defined in the MPEG-4 standard which means any portable audio device has the capability to add support for the format. The iTunes Music Store uses AAC at 128kbps. However, the iTunes Music Store wraps the FairPlay DRM protection around the MPEG-4 AAC files it sells. FairPlay is proprietary to Apple and currently Apple does not license it to other companies so the iPod remains the only player to be able to play files bought from the iTunes Music Store. Any music ripped to AAC in iTunes does not have any DRM protection attached to it. Ogg Vorbis is an open-source and patent free audio format. MP3 and AAC are patented formats that must be licensed in order to be used. The advantage to Ogg Vorbis is that it is free to use without any restrictions. Ogg Vorbis should sound better than MP3 at the same bit rate. Ogg Vorbis has a few portable audio players that play it and media player software is beginning to support it more. A lot of game developers are using the format to avoid paying licensing fees. Ogg Vorbis is not supported by the iPod.

MPC is considered the best lossy audio format today. It excels at bitrates above 160 kbps and can achieve transparency in the 160 - 200 kbps range to most people on most samples. However, MusePack doesn't have much support. No portable audio device yet plays this format and only a handful of media players support playback of MusePack natively. Most media players require a plug-in to support MusePack. iTunes does not support this format and neither does the iPod. WMA is Microsoft's answer to MP3. Exclusive to the Windows platform, WMA offers better sounding files at lower bit rates but currently WMA is not the best audio format. Better tuned MP3 encoders, AAC, Ogg Vorbis, and MusePack all beat WMA's quality at 128kbps and above. This format is not supported by the iPod but iTunes does offer a feature to convert WMA files to AAC/MP3 files for playback on the iPod.

FLAC stands for Free Lossless Audio Codec which is exactly what it is. It is non-patented and open-source. It supports multiple computing platforms and is considered the best lossless codec available by many. Encoding and decoding are both fast, compression is good, and seeking throughout a file is also fast. Currently, iTunes and iPod do not support FLAC. APE is another lossless compression format. It generally compresses better than FLAC using the highest setting, however, having the best compression isn't the best thing when talking about a lossless codec. Monkey's Audio is a Windows-only format and encoding, decoding, and seeking is slower than FLAC. WAV is the main format used for raw and typically uncompressed audio. The usual bitstream encoding is the Pulse Code Modulation (PCM) format.Uncompressed WAV files are quite large in size, so, as file sharing over the Internet has become popular, the WAV format has declined in popularity. However, it is still a commonly used, relatively "pure", i.e. lossless, file type, suitable for retaining "first generation" archived files of high quality, or use on a system where high fidelity sound is required and disk space is not restricted. WE did not blindly believed on all these theoritical data and did extensive encoding in various patterns. We tried our hands on MP3,OGG/VORBIS,FLAC,AAC. These comes preinstalled with the katest vesrion of ffmpeg.Only AAC need to build from source. For audio streaming we had two groups:1.File streaming 2.Live Voice streaming File streaming:MP3:General command:ffmpeg -i Desktop/test.mp3 -acodec libmp3lame -ab 64k -ac 2 -re -f rtp rtp://234.5.5.5:1234

Intermediate status:- size=

135kB time=17.19 bitrate= 64.5kbits/s

2.4 MB(if we just stores it inspite of encoding) Takes input from test.mp3 encodes at bitrate of 64K and streams. The rate can be varied as we want. And can help in making adaptive streaming which I am planning ahead. :) Remember file time is 5:02 The streaming Kbps was well around 64-66K(Variable). We tried to use inculcate few changes:1.bitrate>> 128k File size=4.6Mb(If we just store it by encoder) The streaming rate was well around 120-130 Kbps Quality:-aq was introduced and varied It cause stream rate to increase to 80-90 Kbps and almost 1.75 times the file size.(But Whenfile was opened the bitrate there was 32!!!!!!!!!!!!!!!!) OGG:- ffmpeg -i Desktop/test.mp3 -acodec libvorbis -ab 64k -ac 2 -re -f rtp rtp://234.5.5.5:1234 Intermediate status >> size= 3 MB Stream rate around 64-66 Kbps If we increase bitrate to 128Kbps>> 130 Kbps streaming But when quality is increased a sudden peak was observed!! Bit rate increased to 300 Kbps just with introduction of parameter and kept almost same for 100-255 range!!!! and so was the file size. 142kB time=16.80 bitrate= 69.5kbits/s

FLACC:- This does seem to be made for streaming.Very high quality no doubt.File size almost 7-8 times and stream rate approaches 500-600 Kbps. 2.Live voice streaming:--Command:ffmpeg -f alsa -ab 64k -ac 2 -i hw:0,0 -acodec libmp3lame -re -f rtp rtp://234.5.5.5:1234 ///////////////////////////////////////////////// Input #0, alsa, from 'hw:0,0': Duration: N/A, start: 62261.256993, bitrate: N/A Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s

Output #0, rtp, to 'rtp://234.5.5.5:1234': Stream #0.0: Audio: libmp3lame, 44100 Hz, stereo, s16, 64 kb/s /////////////////////////////////////////////////////////////// MP3:-Stream rate is around 65 Kbps. ///////////////////////////////////////////////// OGG ffmpeg -f alsa -ab 64k -ac 2 -i hw:0,0 -acodec libvorbis -re -f rtp rtp://234.5.5.5:1234 ////////////////////////////////////////////////////////////////////// Input #0, alsa, from 'hw:0,0': Duration: N/A, start: 62386.256956, bitrate: N/A Stream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s Output #0, rtp, to 'rtp://234.5.5.5:1234': Stream #0.0: Audio: vorbis, 44100 Hz, stereo, s16, 64 kb/s ///////////////////////////////////////////////////////////////////// Stream rate:- same. The same problem persists with the Flac still here. As per My trials if we want voice/file transmission without using the quality "-aq " syntax the ogg is best. At lower bit rates it was a bit distinguisable in quality but as we went above 128 all seems equal to ear and even confirmed by theory. We should target ogg for our purpose as it is theoritically better too and have no licencing issues. Used by html5 and many other open source project to date. And most importantly we achieved same bit rate a better quality if we don't move in "-aq" syntax (which is literally puzzling!!)

Вам также может понравиться