audio streaming:-

Upload: jay-prakash

Post on 05-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Audio Streaming:-

    1/4

    Audio formats: lossy and lossless.Lossy formats throw out audio information when encoding to lower the file size of the song sono lossy format is technically CD quality. However, perceivable quality is more important andlossy formats can provide audio that is indistinguishable from the original CD. Lossless formatswork like Zip files. It compresses your audio as much as it can without throwing out any audioinformation. When the losslessly compressed file is decompressed it will have the same qualityit had before it was compressed. In other words, lossless formats retain the CD quality audio onyour 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 towhich is best, it all depends on your hearing. Do some comparison tests between the CD qualityaudio and encoded files at various bit rates and determine which sounds best to you. Bit ratesare used in the following ways:

    CBR (constant bit rate) - The file is encoded using the same bit rate throughout theentire file.

    VBR (variable bit rate) - The bit rate changes throughout the file according to thecomplexity of the music to offer the best quality.

    ABR (average bit rate) - This is a simple VBR mode where the bit rate fluctuates throughout 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 compressioncodec which means it is also the oldest lossy compression format. MP3 can achievetransparent, or indistinguishable from CD, quality at around 192kbps-256kbps to most people onmost samples. The LAME encoder is highly recommended when encoding MP3s by the folks atHydrogenaudio.org. It is the highest quality MP3 encoder available. If you are concerned aboutcompatibility 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 audioplayer. At any bit rate, AAC should sound better than MP3. Likewise, a 128 kbps AAC fileshould sound better than a 128 kbps MP3 file. AAC is gaining popularity and so it is becomingcompatible with more media players but currently the iPod is the only major portable audiodevice that can playback MPEG-4 AAC. Note that AAC is not owned by Apple. It is defined inthe MPEG-4 standard which means any portable audio device has the capability to add supportfor the format. The iTunes Music Store uses AAC at 128kbps. However, the iTunes Music Storewraps the FairPlay DRM protection around the MPEG-4 AAC files it sells. FairPlay is proprietaryto Apple and currently Apple does not license it to other companies so the iPod remains the onlyplayer to be able to play files bought from the iTunes Music Store. Any music ripped to AAC iniTunes 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 formatsthat must be licensed in order to be used. The advantage to Ogg Vorbis is that it is free to usewithout any restrictions. Ogg Vorbis should sound better than MP3 at the same bit rate. OggVorbis has a few portable audio players that play it and media player software is beginning tosupport it more. A lot of game developers are using the format to avoid paying licensing fees.Ogg Vorbis is not supported by the iPod.

  • 7/31/2019 Audio Streaming:-

    2/4

  • 7/31/2019 Audio Streaming:-

    3/4

    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:02The streaming Kbps was well around 64-66K(Variable).

    We tried to use inculcate few changes:-1.bitrate>> 128kFile size=4.6Mb(If we just store it by encoder)The streaming rate was well around 120-130 Kbps

    Quality:--aq was introduced and variedIt cause stream rate to increase to 80-90 Kbps and almost 1.75 times the file size.(But Whenfilewas 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= 142kB time=16.80 bitrate= 69.5kbits/s

    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 justwith introduction of parameter and kept almost same for 100-255 range!!!! and so was the filesize.

    FLACC:- This does seem to be made for streaming.Very high quality no doubt.File size almost7-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/AStream #0.0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s

  • 7/31/2019 Audio Streaming:-

    4/4

    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./////////////////////////////////////////////////OGGffmpeg -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/AStream #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 oggis best.

    At lower bit rates it was a bit distinguisable in quality but as we went above 128 all seems equalto ear and even confirmed by theory.

    We should target ogg for our purpose as it is theoritically better too and have no licencingissues.

    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!!)