
Flv.js – An HTML5 Flash Video Player - fqj1994
https://github.com/Bilibili/flv.js
======
bytesandbots
Note the distinction between two types of js driven video playback that are
possible. Those which require transcoding and those who can do with just
transmuxing.

HTML5 playback can only support few codecs but FLV can contain a wide variety
of video and audio codecs. Flv.js does a great job of transmuxing h.264 frames
in a different container, hence it only plays those flv which are h.264/aac.
Transcoding can make it possible to even play HEVC or any non-standard codec
on browser. This can be heavy on CPU especially hand-held devices. When using
one of these in production you must understand that it is not very practical
to do transcoding on the fly like this :
[https://strukturag.github.io/libde265.js/](https://strukturag.github.io/libde265.js/)
. _It is theoretically possible to play vp9 on an ios or a hevc on a pc but
this will be impractical for low-cpu devices._

~~~
zerocrates
Obviously this has value as a drop-in solution for some, but given what it's
doing it seems like it'd be preferable for most situations to just re-mux the
videos ahead of time.

------
neilsimp1
I wonder if something like this could ever support DRM. I'm thinking of this
mainly for playing Hulu videos on Linux[0]. I consistently have issues with
Flash on Ubuntu with Hulu freezing or displaying something along the lines of
"Error loading DRM content"

[0] [http://www.howtogeek.com/239682/how-to-watch-hulu-on-
ubuntu-...](http://www.howtogeek.com/239682/how-to-watch-hulu-on-ubuntu-and-
other-linux-distributions/)

~~~
bytesandbots
Do you also get this problem with Chrome browser? If you are using Firefox, it
uses an old flash player 11.2 which does not have full support for flash drm.
Google chrome for linux comes pre-packaged with pepper-flash, a chrome-only
port of the latest flash player. That one should work.

~~~
neilsimp1
Chrome did the trick, I wish I had tried that ages ago. Both Hulu and Netflix
only work with Chrome on Ubuntu for me.

------
speps
Relies on Media Source Extensions, pretty widely supported already :
[http://caniuse.com/#feat=mediasource](http://caniuse.com/#feat=mediasource)

------
yoz-y
I wonder. Could something like this be packaged as an extension and thus
enable javascript-powered codecs for browsers that do not have the full set?
(webm for Safari comes to mind)

~~~
TD-Linux
Yes, in fact it's even deployed on Wikipedia:
[https://github.com/brion/ogv.js/](https://github.com/brion/ogv.js/)

~~~
chris_wot
Seriously, the contributions of Brion Vibber to the world are completely
undersung.

However, isn't this server side and not clientside?

~~~
TD-Linux
Nope, it's a clientside "polyfill of <video>", basically. Try out the demo in
the page - it does all playback in Javascript and WebGL.

------
TazeTSchnitzel
IIRC, before Google bought them, some of On2 Technologies' earlier VP codecs
were used in Flash Player (Wikipedia says VP6 and VP7). Are they similar
enough to WebM's VP8 that transcoding would be simple? (I'm guessing not.)

------
greggman
I'm wondering if Adobe couldn't just run flash through emscripten for
WebAssembly. I'd be curious what problems are still there. Offscreen Canvas is
coming soon which should help in some ways.

~~~
BHSPitMonkey
Honestly, that would make sense and make a lot of people who are still
invested in Flash pretty happy. They may prefer to devote those resources
toward their current technologies rather than continuing to support the dying
Flash development platform, though.

------
IshKebab
This looks like it would have been really useful 5 years ago!

------
xmichael99
Any live demos of this playing H264 or RTMP?

~~~
fqj1994
You can click into any video in bilibili.com (flv.js authoring company's video
site) and select HTML5 player(with google translate).

------
print_r
The million dollar question. Will it play flv with alpha channels?

------
bobajeff
I imagine this is for video site's that still have a lot of flv's which
they'll never reencode but want to work on devices that don't have flash
player.

~~~
exodust
Maybe, but then again it says "long live FLV!" on the github page, as if they
actually favor this format.

~~~
cooper12
It's a play on the phrase "The king is dead, long live the king!", which means
long live the successor, who is flv.js in this case.

~~~
exodust
Yes I understand the origin of the phrase.

To keep running with your great story about the king, it is not the JS library
which is the successor, as you claim, it's still FLV. Which brings us back to
the original question of why this was done in the first place - the reason now
I don't even care to know.

~~~
cooper12
I assumed it was done for historic reasons so in the future websites like
archive.org could continue playing flash. (like Shumway [0]) We would lose a
huge library of videos that were created in the format if we could no longer
play them due to browser policies and the obsolescence of the format. In terms
of video encoding, there are much better options these days that don't involve
transmuxing from flash when you're already encoding in h.264, so it likely
isn't so sites can continue serving Flash.

[0]: [https://github.com/mozilla/shumway](https://github.com/mozilla/shumway)

------
detay
an htm5 what?

