13

I am trying to write a JavaScript-based implementation of MPEG-DASH for video streaming. I have referenced the following documents:

These libraries are using MSE (Media Source Extensions).

My understanding

MPEG-DASH is an international standard for streaming video, but it is currently not natively supported in iOS devices. In other browsers and devices, it requires a JavaScript library or a video player that supports MPEG-DASH (eg: Dash.Js, Shaka player).

And another streaming technology is HLS. It is an adaptive streaming communications protocol created by Apple. The Safari browser can play HLS streams within a web page, iPhone, and iPod touch devices.

Here, we can see that MPEG-DASH (because of MSE) is currently not natively supported in iOS devices.

Now, my doubts:

  1. How can we stream MPEG-DASH videos in iOS without MSE?
  2. How Facebook and other streaming media services play their videos? is it with HLS only ?

Any suggestion/explanations would be more than helpful!

dourouc05
  • 128
  • 1
  • 6
user2986042
  • 1,098
  • 2
  • 16
  • 37
  • Clarification https://caniuse.com/?search=mse MPEG-DASH is currently supported in iPad OS, they even bragged about implicitly in an iPad keynote. I suspect this is carrier pleasing, like "5Ge." But also, battery life will be better if you don't watch HD video and use fallbacks instead. – Ray Foss Mar 11 '21 at 21:19

3 Answers3

11
  1. You can’t.

  2. Yes they use HLS. iOS 10 and above support fmp4 in HLS. so the only difference between dash and hls is the manifest.

szatmary
  • 29,969
  • 8
  • 44
  • 57
  • Is this still true? http://viblast.com/player/ claims "You are looking at one of the very few existing solutions that tackle DASH playback in iOS." – Ryan Jan 26 '19 at 23:24
  • 2
    Is still true-ish. It may be possible to convert a mpd to m3u8 in a service worker now. Not sure. – szatmary Jan 26 '19 at 23:37
  • @szatmary Is this really all there is to it? there is no difference in the fragments when using Mp4/AV1? – Ray Foss Mar 11 '21 at 21:07
  • @RayFoss iOS will not play AV1. It will only play AVC and HEVC. – szatmary Mar 11 '21 at 21:09
  • @szatmary Yesterday they merged AVIF support into WebKit, which is AV1... AV1 video is coming soon to newer devices. My question was about what it would take to convert a library of DASH H.264 format videos into HLS... is it just a single file of metadata? – Ray Foss Mar 11 '21 at 21:23
  • @RayFoss AVIF does not mean AV1 is coming soon. Decoding one AV1 frame to display on a web page is one thing. But decoding 60 per second for video is totally different. The WebKit team at Apple is NOT the HLS team. Apple will not support AV1 in HLS until the iPhone has a hardware decoder. – szatmary Mar 11 '21 at 21:31
  • 2
    @RayFoss To answer you question for DASH H.264 to HLS, Yes, just make an m3u8 that points to each fmp4 file, and put the init fragment in the #EXT-X-MAP – szatmary Mar 11 '21 at 22:45
  • @szatmary thank's for the answer! The iOS based Apple TV will have 4K playback support and the old one has been getting a lot of hate in the media. The M1 is already capable of handling AV1 decoding at low bitrate 4k. Apple knows how to squeeze it's 8-wide decode block and GPU's. https://www.anandtech.com/show/16226/apple-silicon-m1-a14-deep-dive/2 – Ray Foss Mar 11 '21 at 23:05
  • 1
    @RayFoss Apple TV can decode pretty much anything in software. But that's because it has a power cord that plugs into the wall. The Phone which is expected to have good battery life will be the blocker for adoption in HLS. Decoding AV1 is not a massively parallel problem, The standard GPU wont cut it. It needs dedicated hardware primitives. This is why QuickSync / NVENC / VideoToolBox all exist. Also the M1 Pulls 40 Watts (which is very impressive) But the A14 pulls ten times less! – szatmary Mar 11 '21 at 23:29
2

Try providing both HLS and DASH containers and let media queries choose the appropriate one.

brasofilo
  • 25,496
  • 15
  • 91
  • 179
  • 7
    Hi Cary, if you need clarification about the question, you should post a comment below the question. Answers should provide a solution to the problem presented. I took the liberty of changing the wording of your answer so it's more "answer-like" than "comment-like" – brasofilo Jul 05 '19 at 20:24
1

You can setup proxy server on a device and then create a parser that will be translating mpd files into m3u8 and serve m3u8 for AVPlayer. For ios proxy GCD should do the trick: GCDWebServer

kuvukala
  • 66
  • 7