關於 KeyCDN 的 HLS streaming 最佳化...

KeyCDN 發表了對 HLS streaming 的最佳化:「New feature: Optimized HLS streaming」。

其中這段看起來就很奇怪:

The index file (.m3u8) will not be cached at all. The .ts files will only be cached for 5 minutes. If the origin server sends other Cache Control headers, it will be ignored by the CDN.

也就是這個畫面:

如果你把對 .m3u8 的壓力全部打到後端,那麼就註定不 scale 啊?之前在 EC2 c3.8xlarge 上面用 Wowza 測試,就發現單台最多只能承受 4000 reqs/sec。

比較好的作法應該是 cache 很短的時間 (也許三到五秒),讓 CDN 幫你擋下來,而不是前面打多少 reqs/sec 後面就吃多少...

在 Flash 上播 HLS...

靠的是「Apple’s HTTP Live Streaming (HLS) in Flash !」這篇「2014/02/12 的 comment」解的 (不是原文內的方法)。

專案在 GitHub 上:「HLSProvider is a Flash/AS3 plugin that plays back HLS streams」。

使用方式與範例可以在「HLSprovider/test/flowplayer at master · mangui/HLSprovider」這邊翻到,直接看 index.html,並且把 swf 檔弄出來就可以動了。

不過實際測試發現 buffer 的部份好像處理的不是很好... 但至少有東西可以用了 :o