Page MenuHomePhabricator

Support for webm videos in Safari
Closed, ResolvedPublic

Description

As noted in https://phabricator.wikimedia.org/rETMHe1afff020fd089b7bb5265a57489f040bf2d997f, Safari on iOS doesn't support webm. This leads to a very poor (low resolution) video experience when viewing video in Safari on iOS. Would it be possible to expand the compatibility of the Commons video player so that HD webm videos can play in Safari on iOS?

Event Timeline

Pine created this task.May 20 2016, 7:05 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 20 2016, 7:05 PM
brion added a subscriber: brion.

This is dependent on getting good enough performance in ogv.js for VP8 video, and fixing the webm demuxer. Currently 480p WebM in ogv.js requires an iPad Pro for good enough iOS performance, still is too slow on some files, and doesn't support seeking. HD would require a several times increase in performance.

This is not trivial to fix, so don't expect it to be done any time soon! Very low level work, could literally take a year or two rewriting he the codec library.

Here have a blog post:

brion added a comment.May 20 2016, 7:47 PM

Note that HD .ogv is much easier to do because the decoding is faster, but at twice the data rate and poorer quality than webm I'm inclined to keep the ogv max at 480p / 2 Mbits, which is same data rate as our WebM VP8 720p / 2 Mbps.

Note also that the format of source videos is never relevant to the formats used for output: all videos are converted to the same output formats.

@brion is there a feature request bug open on webkit since if we open one we can get webkit to add support for it and then apple will add it to ios.

brion added a comment.May 21 2016, 3:50 PM

@Paladox, WebKit is not at issue, other WebKit browsers are perfectly capable of running webm if they choose.

For Safari, the support for the codecs would be needed in OS X & iOS's media layer because their policy at Apple is to only support media through the operating system's media layer. So, as Apple engineers have told me, we can file bugs against the Foundation/Core Media end of things with Apple...

But don't expect positive responses there either. Here's some bugs I filed with Apple for that low level support:
rdar://22918706 - vp9 (no response)
rdar://22918182 - opus (closed as no plans to address)

Feel free to file more bugs to Apple:
https://developer.apple.com/bug-reporting/

Apple's bug reports are not public, so you may wish to also copy paste the results to openradar:
http://www.openradar.me/

@brion I can file it in the feedback app on my ipad pro too.

@brion Ive submitted a report in the feedback app. I also linked it to this task here.

brion added a comment.May 31 2016, 2:01 PM

I'm reopening T108172 for adding high-def .ogv transcodes, as in my testing it's not as bad as I feared in terms of overall bandwidth usage. This should get 720p and 1080p playback in Safari working until we convince Apple. ;)

Just a quick update -- iOS 10 has noticeably improved JavaScript performance, speeding up the ogv.js decoders for both Ogg Theora and WebM VP8. It also drops support for the slowest A4/A5 processors (anything older than an iPhone 5 / iPad 4th-gen), meaning any device detected as being on Safari of a certain version will have a much higher performance floor than previously.

With the 'Tears of Steel' Blender movie (24fps, letterboxed) I'm seeing fairly acceptable performance on these profiles under iOS 10:

  • iPad Pro 9.7" (A9X) -- 480p WebM or 1080p Ogg
  • iPad Air (A7) -- 360p WebM or 720p Ogg
  • iPhone 5C (A6) -- 160p WebM or 360p Ogg

and on Mac OS X El Capitan with Safari Technical Preview 13 (have not yet tested macOS Sierra which is about to come out):

  • MacBook Pro 13" 2015 (Core i7 3.1 GHz) -- 480p WebM or 1080p Ogg
  • MacBook Pro 13" 2010 (Core 2 Duo 2.4 GHz) -- 360p WebM or 720p Ogg

Ogg Theora can generally be played at a full resolution or two higher than WebM, but the smaller WebM uses a lot less bandwidth (both because VP8 compresses better than Theora, and because it's a lower resolution and thus less data).

Although I like the higher resolution we can get out of Ogg Theora, I'm inclined to think about at some point switching to WebM as the default for the bandwidth savings.

Pine added a comment.Sep 16 2016, 7:02 PM

I'd strongly prefer to have the higher resolution. How about this: (1) default to WebM when using mobile data connections, and default to Ogg when using local wireless or wired connections, and (2), make clear to users, in a way more obvious than it is now, that they can switch formats, maybe by prominently displaying a button for "View in higher resolution (for high speed connections)" or "View in lower resolution (for low speed connections)"?

brion closed this task as Resolved.Jan 14 2017, 5:15 AM
brion claimed this task.

Going ahead and closing this out as resolved; though the task _asks_ for WebM my understand is what was _desired_ was decent-quality HD output. :) .ogv transcodes are now produced in HD (720p and 1080p) as well as SD resolutions, and should nearly match the quality of the WebM output in most cases (at a higher bitrate due to the older compression).

Some older non-HD transcodes were at low bitrates and still look bad; they can be reset if need be and eventually will be batch-redone. Newer transcodes should look pretty decent generally, and you can crank up to HD in the player.

See also T127668 which is similar re: IE/Edge.