简体   繁体   English

iPhone HE-AAC流媒体直播(3G)

[英]iPhone HE-AAC Streaming over Mobile Network (3G)

Developed an internet radio streamer using jPlayer which utilizes the html5 audio tags with jQuery and has a flash fall back for unsupported browsers. 使用jPlayer开发了一个互联网广播流媒体,它使用带有jQuery的html5音频标签,并为不支持的浏览器提供闪回功能。 Upon testing the player on the iPhone (iOS 5.0.1), we ran into a very peculiar issue. 在iPhone(iOS 5.0.1)上测试播放器后,我们遇到了一个非常特殊的问题。

When the iPhone is connected to WiFi, it streams perfectly using the HE-AAC V2 stream @ 64kbps 44.1kHz (the preferred codec for apple products). 当iPhone连接到WiFi时,它使用HE-AAC V2流@ 64kbps 44.1kHz(苹果产品的首选编解码器)完美地流式传输。 However, when the iPhone is connected to the 3G mobile network, it "stutters" or stops streaming for 1-2 secs every 1-2 minutes (does not stop streaming completely). 然而,当iPhone连接到3G移动网络时,它会“断续续续”或每1-2分钟停止流动1-2秒(不会完全停止流式传输)。 The troubling thing is when the iPhone is forced to use a separate MP3 stream at the same bit rate, it does not have this issue and works very well on 3G. 令人不安的是,当iPhone被迫以相同的比特率使用单独的MP3流时,它没有这个问题并且在3G上运行良好。

UPDATE 5 更新5

We recently acquired a 3G/4G Sprint mobile hotspot device and tested this issue with the device. 我们最近购买了3G / 4G Sprint移动热点设备,并使用该设备测试了这个问题。 When the iPhone is connected to the mobile hotspot, it shows as being connected to a wifi device and the issue does not render even tho the actual connection is via 3G/4G. 当iPhone连接到移动热点时,它显示为连接到wifi设备,即使实际连接是通过3G / 4G,也不会出现问题。 This might point back to the issue being with the iPhone not handling HE-AAC via HTTP Live Streaming and when directly connected to the mobile network. 这可能会回到iPhone不通过HTTP直播和直接连接到移动网络处理HE-AAC的问题。

UPDATE 4 更新4

Updated the iPhone to iOS 5.1 yet the issue persists. 将iPhone更新到iOS 5.1但问题仍然存在。

UPDATE 3 更新3

Read here on SO various issues of script not rendering correctly when connected to mobile networks. 请阅读此处有关连接到移动网络时脚本无法正确呈现的各种问题。 The finger seems to point to the mobile network carriers that may be inserting Proxy to serve webpages, eg for downsizing images. 手指似乎指向可能插入代理以服务网页的移动网络运营商,例如用于缩小图像尺寸。 Also it might inject some JavaScript pages. 它也可能会注入一些JavaScript页面。 The test page can be found HERE Note: this page is using HE-AAC so it will only work on iPhone... 测试页面可以在这里找到注意:此页面使用HE-AAC,因此它只适用于iPhone ...

UPDATE UPDATE

According to Apple's HTTP Live Streaming doc for iOS devices, that "Audio-only content can be either MPEG-2 transport or MPEG elementary audio streams, either in AAC format with ADTS headers or in MP3 format." 根据Apple针对iOS设备的HTTP Live Streaming doc,“仅音频内容可以是MPEG-2传输,也可以是MPEG基本音频流,无论是采用ADTS标头的AAC格式还是MP3格式。” Our music server is using OddcastV3 encoder to send out three streams (MP3, HE-AAC V2, and Oggvorbis) to the icecastV2 server. 我们的音乐服务器使用OddcastV3编码器向icecastV2服务器发送三个流(MP3,HE-AAC V2和Oggvorbis)。 Not sure if the encoder is inserting ADTS headers for the HE-AAC V2 stream. 不确定编码器是否正在插入HE-AAC V2流的ADTS标头。 Is there a way to check for this? 有没有办法检查这个?

Comming from a radio planning point of view - here are my two cents: 从无线电规划的角度来看 - 这是我的两分钱:

What you are describing sounds like bandwidth shaping - which is both a common and often neccesary design of radio networks (like 3G networks). 您所描述的内容听起来像带宽整形 - 这是无线电网络(如3G网络)的常见设计和常用设计。 In most 3G operators I worked at you would typically optimize your network to give high-speed burst (think downloading an image, sending one email or fetching one HTML page) - over "long-running" high bandwidth services. 在我工作的大多数3G运营商中,通常会优化您的网络以提供高速突发(想想下载图像,发送一封电子邮件或获取一个HTML页面) - 通过“长期运行”的高带宽服务。 This is due to the simple fact that this is what most users want/need. 这是因为这是大多数用户想要/需要的简单事实。

This shaping can on a typical 3GPP (GSM 3G) network result in that you will first get a RAB (radio access bearer) supporting 384kbit and is then downgraded as long as your your device accepts it. 这种整形可以在典型的3GPP(GSM 3G)网络上导致您首先获得支持384kbit的RAB(无线电接入承载),然后只要您的设备接受它就降级。 This means that typicall you will get switched from 384 -> 256 -> 128, then 64kbit where maybe your device starts recieving data to slowly, then the network upgrades it and again downgrade it after a while. 这意味着典型的你将从384 - > 256 - > 128切换,然后64kbit,你的设备可能开始慢慢接收数据,然后网络升级它,并在一段时间后再次降级。

So why is not then the MP3 file stuttering? 那么为什么不是MP3文件口吃呢? my guess is that the total kbit rate might differ - so you are fine in the 64kbit RAB. 我的猜测是总的kbit率可能会有所不同 - 所以你在64kb的RAB中没问题。 This is a common phenomena. 这是一种普遍现象。

We have managed to get the exact same thing working. 我们设法完成同样的工作。 64kbit AAC-v2 on mobile devices. 移动设备上的64kbit AAC-v2。 We are streaming files and not a steady stream, I think Magnus is right when he explains how the network prioritized traffic to bursts, in our case that means we have large parts of the file right away and the player can continue to play until he next burst comes in. In your case that means the stream pauses until the next burst comes. 我们是流媒体文件,而不是源源不断,我认为Magnus是正确的,当他解释网络如何优先考虑流量突发时,在我们的情况下,这意味着我们立即拥有大部分文件,播放器可以继续播放直到下一个爆发进来。在你的情况下,这意味着流暂停直到下一次爆发。

Either if you can switch to larger chunks in your streaming (larger buffer) or stream whole files instead? 如果您可以在流式传输(更大的缓冲区)中切换到更大的块或者改为流式传输整个文件?

We had a very strange phenomenon with iOS, we had to rename all files from .m4a to .aac to be able to get them streaming on iOS. 我们在iOS上遇到了一个非常奇怪的现象,我们不得不将.m4a中的所有文件重命名为.aac,以便能够在iOS上进行流式传输。 If we didn't rename them iOS wouldnt play them. 如果我们没有重命名它们iOS就不会播放它们。

Good luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM