Best bitrate to use for streaming audio via mobile - audio

I run a podcasting site where users can stream the podcasts via a HTML5 player. I've just optimized my site for mobile so that users can listen on the go.
Issue I'm having is that it tends to buffer a lot as the MP3 quality on all the podcasts is V0, which I'm finding must be too high for mobile connections! Plus the amount of data it transfers would be too high for a lot of people's phone contracts to justify bothering with.
Rather than trial and error loads of different bitrates, I was wandering if anyone knew the best MP3 bitrate to go with for mobile streaming. I.e., which bitrate is low enough to allow a stream which has little to no buffering over 3G, but is high enough not to notice the quality degradation.

Related

WebRTC - how to synchronize media streams

I'm using WebRTC in a sort of non-conventional way.
I have multiple streams generated by several 'broadcasting' peers being sent to a collection of several 'receiving' peer.
I intend to use an SFU media server (maybe Jitsi or Kurento)
It is very critical that these streams are presented at the receiving peers in a synchronized fashion.
What are the methods I can use for synchronization? Usually this isn't an issue with WebRTC because there is not usually a consistent clock between peers, but in my case there is a common clock for all the stream sources.
The only ways I can imagine doing it are:
Not worry about it and hope that WebRTC's low latency will cause everything to be in sync.
Somehow encoding timestamp metadata in the WebRTC stream frames, and somehow synchronizing display with javascript in the browser.
Using a tool like GStreamer that can perform video synchronization, mix the streams into a single stream and forward that to the media server (and thus to the receiving clients). I don't have a good idea of how I would actually perform the synchronization though.
Any thoughts and advice would be appreciated.
The only OTT system capable of synchronisation of low latency streams available (when writing this text), is the SYE system made by Net Insight. They are able to synchronise any device down to single digit millisecond in low latency mode.
They do not provide any open source that I know of but you can check it out by downloading a app that uses it.
Primetime
The game starts 20:00 CET every day, download it on several phones/tablets to verify the sync part.
However there are other systems that can synchronise playback that I found.
HibbTV
HibbTV seams to focus on more IPTV replacement solutions as I interpret the solution. They do not seam to target the wild west of internet. I might be wrong please correct me then.
W3C MULTI-DEVICE TIMING COMMUNITY GROUP
Spoke to the researchers a while back. They can synchronise playback but they target collaborative viewing. The low latency part is not part of the scope as I understand it.
Then when it comes to WebRTC, LHLS, MPEG-DASH CMAF and all other solutions they have no sense of time so it will not be possible to render the same video frame on different devices using various access technologies such as 4G, WiFi or cable or even if the devices uses the same technology because the rendering is buffer controlled not time controlled.
/Anders

What's the best protocol for live audio (radio) streaming for mobile and web?

I am trying to build a website and mobile app (iOS, Android) for the internet radio station.
Website users broadcast their music or radio and mobile users will just listen radio stations and chat with other listeners.
I searched a week and make a prototype with Wowza engine (using HLS and RTMP) and SHOUTcast server on Amazon EC2.
Using HLS has a delay with 5 seconds, but RTMP and SHOUTcast has 2 second delay.
With this result I think I should choose RTMP or SHOUTcast.
But I am not sure RTMP and SHOUTcast are the best protocol. :(
What protocol should I choose?
Do I need to provide a various protocol to cover all platform?
This is a very broad question. Let's start with the distribution protocol.
Streaming Protocol
HLS has the advantage of allowing users to get the stream in the bitrate that is best for their connection. Clients can scale up/down seamlessly without stopping playback. This is particularly important for video, but for audio even mobile clients are capable of playing 128kbit streams in most areas. If you intend to have a variety of bitrates available and want to change quality mid-stream, then HLS is a good protocol for you.
The downside of HLS is compatibility. iOS supports it, but that's about it. Android has HLS support but it is still buggy. (Maybe in another year or two once all the Android 3.0 folks are gone, this won't be as much of an issue.) JWPlayer has some hacks to make HLS work in Flash for desktop users.
I wouldn't bother with RTMP unless you're only concerned with Flash users.
Pure progressive streaming with HTTP is the route I almost always choose to go. Everything can play it. (Even my Palm Pilot's default media player from 12 years ago.) It's simple to implement and well understood.
SHOUTcast is effectively HTTP, but a poorly implemented version that has compatibility issues, particularly on mobile devices. It has a non-standard status line in its response which breaks a lot of clients. Icecast is a good alternative, and is what I would recommend for production use today. As another option, I have created my own streaming service called AudioPump which is HTTP as well, and has been specifically built to fix compatibility with oddball mobile clients, such as native Android players on old hardware. It isn't generally available yet, but you can contact me at brad#audiopump.co if you want to try it.
Latency
You mentioned a latency of 2 seconds being desirable. If you're getting 2-second latency with SHOUTcast, something is wrong. You don't want latency that low, particularly if you're streaming to mobile clients. I usually start with a 20-second buffer at a minimum, which is flushed to the client as fast as it can receive it. This enables immediate starting of the stream playback (as it fills up the client-side buffer so it can begin decoding) while providing some protection against buffer underruns due to network conditions. It's not uncommon for mobile users to walk around the corner of a building and lose their nice signal quality. You want your stream to survive that as best as possible, so if you have already sent the data to cover the drop out, the user doesn't have to know or care that their connection became mediocre for a short period of time.
If you do require low latency, you're looking at the wrong technology entirely. For low latency, check out WebRTC.
You certainly can tweak your traditional internet radio setup to reduce latency, but rarely is that a good idea.
Codec
Codec choice is what will dictate your compatibility more than anything else. MP3 is easily the most compatible, and AAC isn't far behind. If you go with AAC, you get better quality audio for a given bitrate. Most folks use this to reduce their bandwidth bill.
There are licensing fees with MP3, and there may be with AAC depending on what you're using for a codec. Check with a lawyer. I am not one, and the licensing is extremely complicated.
Other codecs include Vorbis and Opus. If you can use Opus, do so as the licensing is wide open and you get good quality for the bandwidth. Client compatibility here though is the killer of Opus. (Maybe in a few years it will be better.) Vorbis is a mediocre codec, but is free and clear.
On the extreme end, I have some stations doing their streaming in FLAC. This is lossless audio quality, but you're paying for 8x the bandwidth as you would with a medium quality MP3 station. FLAC over HTTP streaming compatibility is not code at the moment, but it works alright in VLC.
It is very common to support multiple codecs for your streams. Depending on your budget, if you can't do that, you're best off with MP3.
Finally on encoding, don't go from a lossy codec to another lossy codec if you can help it. Try to get the output stream as close to the input as possible. If you re-encode audio, you lose quality every time.
Recording from Browser
You mentioned users streaming from a browser. I built something like this a couple years ago with the Web Audio API where the audio is captured and then encoded and sent off to Icecast/SHOUTcast servers. Check it out here: http://demo.audiopump.co:3000/ A brief explanation of how it works is here: https://stackoverflow.com/a/20850467/362536
Anyway, I hope this helps you get started.
Streaming straight audio/mpeg (mp3 packets) has worked everywhere I've tried.
If you are developing an APP then go with AAC, if you are simply playing via web browser then you need a HTML5 Implimentation which is MP3. All custom protocols like RTMP or SHOUTcast requires additional UI to be built. There are some third party players available in open source world. You can either use them or stick to HTML5 MP3/OGG as most people now days are using chrome browser or other HTML5 complaint browsers.

Cheapest most accessible shoutcasting solution

I want to broadcast a looped 24/7 uninterrupted audio file across the internet in the cheapest and most accessible way. By accessiblity I mean a native browser from any OS can play it without any additional downloads of plugins/players, etc. I would like any computing device that can play audio, and can open an HTTP link, to be able to listen in. The audio is 2 hours and 30 mins long, and the file is currently sitting at 145MB encoded in MP3 format at 44100Hz, 128Kbps, 2 channel stereo, 32-bits.
The audio will be accessed by simply visiting a public HTTP webpage where it will begin streaming upon joining, without links, or even a transport to stop/play/rewind/fast forward the clip. Users stop the stream by closing the page. It will allow as many listeners as the bandwidth allows without loss of quality. I'm forecasting 10 simultaneous listeners will be the max at this time.
I don't think buying a Shoutcasting service is for me as they include alot of bells and whistles that I don't need for my barebones setup. Plus, I don't want to force people into downloading some type of player.
Here's a recap of my questions:
Is MP3 format really the one I want? If I have a better guarantee of accessibility with WAV I may consider it despite it's filesize; I don't expect listeners to stay through the entire 2 hours 30 mins duration anyways.
Should I pay for a shoutcasting service or can I set it all up myself with some free shoutcasting server software?
If you want compatibility, SHOUTcast isn't for you. It isn't fully compatible with HTTP which prevents usage on a lot of devices and browsers. Icecast is more compatible. You can host it yourself if you want, or you may be able to find a cheap hosting service for similar cost.
MP3 is a very compatible codec, but not everything supports it. To be most compatible, you need to stream multiple codecs at the same time. MP3, AAC, and Ogg-Vorbis are the most compatible when all three are used together.

Audio enhancement over windows

I am from signal processing background. When I listen audio from youtube, sometime I feel the chances of improvement in audio quality at run time. These basic improvements will be auto adjusted as per the audio content. I mean, there is a possibility of write a generalized or feedback based algorithm.
I am aware to test my algorithm on offline audio(recorded audio file). But I do not know, how can I interface my algorithm with youtube audio? Is it possible to write some windows API which activates whenever any audio plays over the machine.

increase the gain of an incoming audio stream

all my questions relate to the same problem: adjusting the gain of an external audio stream on a webpage.
when you visit my webpage, you will hear an audio stream from my online radio station.
the audio stream is delivered through a flash player which is embedded into the page.
the flash player cannot be changed, the only variable in the code i was provided was to change the address of the stream that is played. the stream is an online radio station.
the station broadcasts at a level which is way below 0dB so using the volume control does very little to increase the sound heard on the website.
i need a code that i can add to my standard player code:
to increase the gain of the stream heard on the website OR a completely new Flash player code that will stream the audio from the station as well as increase the gain of the audio.
please help guys.
Unfortunately, you cannot (currently) modify that stream client-side. You cannot increase the gain. All you can do is set the volume at 0dB with a custom Flash player, and it's likely the one you are using now already has it there.
The only way to modify the audio content is to do the compression and gain server-side, and re-encode the stream before sending to the clients. You will have a loss of quality, as you are reducing dynamic range and lossy-compressing data that was already lossy-compressed. The best thing to do is fix the source material.

Resources