
Why we chose to move to HTML5 video - el_duderino
https://code.facebook.com/posts/159906447698921/why-we-chose-to-move-to-html5-video/
======
rloc
Very very late for a company like Facebook. I'm not sure they needed a blog
post to explain such an obvious move.

It looks like they decided to go all for HTML5 at once and avoid having to
live with both Flash and HTML5 support with the cost associated to it
(maintenance, support, etc.).

~~~
fwn
They still seem to use a flash version for some browsers:

> That's why we waited until recently to ship the HTML5 player to all browsers
> by default, with the exception of a small set of them.

~~~
rloc
Then definitely no excuse :)

------
fortyseven
"Why I decided to stop slamming my hand in a car door."

------
ohitsdom
"When we shipped the HTML5 player, we noticed that on average it took slightly
longer for Facebook to load. By fixing several small performance regressions
and making multiple micro-optimizations, we finally reached a level we felt
happy with shipping."

The way that's worded, it sounds like Facebook with HTML5 video is still
slower to load than it was with Flash. This is really surprising... Would love
to read details on that. Do they mean loading a link to a video, or to the
general News Feed?

~~~
mwill
I'm fairly sure it means the entire page. I recently attended a talk given by
Mike Magruder about (mobile) performance at Facebook, and a lot of it involved
testing the impact of changes on the overall speed of the entire product, this
uses the same language, ie referring to Facebook directly when talking about
speed.

Just a wild stab in the dark on the cause, but maybe a contributing factor is
devices that wouldn't load Flash at all take a speed hit from trying to load
HTML5 video and the supporting scripts, or maybe the browser doing more heavy
lifting rather than offloading it to a plugin?

------
nailer
Well the answer's pretty obvious in 2015, but 'The challenges we had to
overcome' section is pretty interesting.

------
billpg
Finally. Ever since I removed the flash plugin around a year or two ago,
Facebook and Vimeo videos are the only things I regularly encounter that I
can't play.

~~~
chrisseaton
The BBC still uses flash for TV and radio, which is a real shame and I think
is the only thing I still need Flash for.

~~~
snthd
Be an ipad (by spoofing your User-Agent header)

[https://news.ycombinator.com/item?id=10298240](https://news.ycombinator.com/item?id=10298240)

~~~
chrisseaton
Wow! It even works for live radio, which they say HTML5 doesn't! Why isn't
this the default?

------
frik
I created an website that shows 100+ short small videos on a page. I tested it
with common browsers on various platforms. And decided to load only the first
5 videos as HTML5 videos and show the rest as animated GIFs. The optimized
GIFs have custom color pallet, the file size is slightly bigger, but the
performance gain is enormous.

~~~
mtgx
That's interesting, considering there's a whole new trend of websites
dedicated to converting heavy GIF files into small video files instead - sites
such as [https://gfycat.com/about](https://gfycat.com/about)

~~~
SquareWheel
The bizarre thing is that the vast majority of these "gifs" come from a video
source in the first place, so all they're doing is converting from a video, to
a gif, back to a video format. This process destroys the quality and sound
channel. Strange how sites like reddit eat this up.

~~~
wodenokoto
The reason why funny videos as gif became big is the promise they give you
that they are funny without sound, so you can play them in the office or
during commute without fear that something will suddenly be noisy, or that
something won't be easily understood.

When gifs started breaking the promise of being fast to load, due to people
sharing fairly large res animations, sites such as gfycat tried to replicate
the promise of silent sketches, but with more modern technology.

This is not bizare at all. Less is sometimes more.

~~~
SquareWheel
This is all certainly accomplishable without converting the video file twice.
<video> tags support a mute attribute, and with minor javascript you can set a
looping playback from a timestamp. Best of both worlds if you really want
that.

I can't help but feel these tools are evolving in the wrong direction. And not
even in a "Stop liking what I don't like!" kind of way; simply that the
solution could have been reached with far fewer steps.

------
scandox
"At Facebook, we care about the experience we provide to people. How long
Facebook takes to load is a contributing factor we look at to gauge user
experience."

Do they really need to talk like this on a tech blog?

~~~
harryf
Sadly they care less about content theft -
[http://youtu.be/IrD96dNfHxk](http://youtu.be/IrD96dNfHxk)

~~~
LoSboccacc
eh, in the link to be reported he put the youtube link and not the page link,
less than five days later issue is resolved, offending page is down,
everyone's happy?

but the video lasts forever, with its partial information taken from a
snapshot in time.

~~~
snthd
>“Freebooting” is a silly but oddly appropriate word invented by YouTubers CGP
Grey and Brady Haran that means “taking online media and re-hosting it on your
website without permission.”

[http://www.itsokaytobesmart.com/post/108548517677/facebook-f...](http://www.itsokaytobesmart.com/post/108548517677/facebook-
freebooting-video)

[https://www.youtube.com/watch?v=L6A1Lt0kvMA](https://www.youtube.com/watch?v=L6A1Lt0kvMA)

~~~
clouddrover
"Freebooter" and "freebooting" mean "pirate" and "piracy", which is what I
assume they're talking about:
[http://www.oxforddictionaries.com/definition/english/freeboo...](http://www.oxforddictionaries.com/definition/english/freebooter)

------
jacquesm
For canned video this decision is less than ground-breaking, but for me the
more interesting question is what the state is with respect to live video
broadcasting to a large audience.

------
Zarel
I wonder if they know about this bug:

[https://code.google.com/p/chromium/issues/detail?id=460709](https://code.google.com/p/chromium/issues/detail?id=460709)

It's been around for nearly a year, and Chromium eventually says they're
following the spec and it's Facebook's fault.

~~~
magicalist
it looks like something is hiding an ancestor of a video element so the video
element is hidden...yes, sounds like a Facebook bug

------
exodust
" _Videos are an enriching way to connect with the world around you_ "

Er... thanks FB for the insight into why videos are good.

Interesting that it doesn't sound like they got page loading time _faster_
than with Flash, only to a point they were happy with.

Don't care. Haven't signed up to FB. Not until I can create feeds of my
content to non-Facebook users, as simple as RSS. Unlisted content, similar to
youtube unlisted videos. The URL discovery completely at my discretion and
risk. You know, like more open, more choice and more in line with the web.
Unshackled from branded ecosystem lock-in. That's all I want.

------
menzoic
The reasons given for the switch could have been easily mitigated. At NYT we
used an HTML5 player by default and then when HTML5 isn't supported we
downgrade to a flash video container, while still maintaining the
HTML/CSS/Javascript player controls. We also have a bridge from Actionscript
to Javascript for logging. We barley have to update the flash video container,
it just acts as a viewport for video.

------
snowwrestler
Tangentially related question: what is the best software/hardware to
economically stream HLS (HTTP Live Streaming) these days?

For live event webcasts, my employer has been using Wirecast to send an RTP
stream to Brightcove. Brightcove is trying to move to HLS for all live
streaming, but can't seem to give us a good recommendation for an economical,
reliable way to create the HLS stream.

Any suggestions would be appreciated!

~~~
slederer
You could try out the live streaming feature of
[http://www.bitcodin.com](http://www.bitcodin.com), it supports HLS as well as
MPEG DASH.

------
shmerl
I really hope Daala (with input from Thor) will catch up and will force Apple
to start supporting open codecs. The situation with fragmented and patent
encumbered video is ridiculous.

Also, streaming situation is getting murky. MPEG-LA patent trolls tried to
attack DASH a while ago. Is it patent free after all or not?

~~~
slederer
Yes, DASH is still royality free

------
jordn
I'm very glad they finally did. Means I can speed up playback speed (using the
excellent
[https://github.com/igrigorik/videospeed](https://github.com/igrigorik/videospeed)
chrome extension)

------
gloves
If Flash wasn't already dead...

------
kenOfYugen
Maybe it's time browsers improve the decoding performance of HTML5 videos. In
my experience Wirth's law is in effect when it comes to browsers.

------
return0
Regardless of their reasons, its a great move as it will push for better
support.

