A Simple Explanation: VLC.js
ascii.textfiles.com
ascii.textfiles.com
It seems like the more the browser takes on the role of an OS the more it will need all the stuff that OS's have built up over the years to make it manageable.
A lot of people think we need to start rethinking the web. But as the poster points out: "but that’s what we have and here we go"
Nobody wanted these things. Users didn't understand the idea. The APIs were clumsy. The framing of the apps added little value over a traditional web app. Portability was a joke.
The best thing to happen to the web is service workers and the new world of "offline" APIs, like the push notification API. They allow pages to get the goodness of a desktop app without the downsides of installing a "native" app.
(source: I helped build the Firefox Marketplace)
For an application like VLC this sort of thing become really important. More important than your typical email client or document editor.
What if VLC uses downstream libx and Audacity also uses downstream libx and downstream libx has a critical 0day. I'm not super clear yet on how the WebAssembly build pipelines works. Is dynamic linking done through script tags? or are the binary blobs statically compiled? I'm genuinely curious here how this is all supposed to work. How does one ensure that downstream libx is updated for all of the WebAssembly applications that use them.
Aren't they banging open doors? HTML5 video and audio is great and with WebAudio and WebGL you can manipulate every aspect of the experience. EQ, filters are possible. What else do you need? Subtitles?
I just don't understand what problem are they trying to solve because "I can't run VLC in the browser" certainly isn't one.
Doing this natively in JS via canvas allows you exactly that - rendering these things natively, in real time, with all the support for rare features you could ever need.
Also, here's a fun quirk of the subtitles track element: you cannot remove a track once added.
Another obstacle for full FCC compliance: styling. You must allow users to style your captions. Captions are put in the shadow DOM - Firefox does not allow you to style the shadow dom.
Don't forget to add IE into the mix!
The author works for the Internet Archive and it obviously has a huge amount of files in a variety of formats that are not playable natively by browsers, and probably never will be.
But playing a DVD, for example, isn't just about codecs, they have menus and various other features that need to be implemented too.
Remember that this is the Internet Archive - they have huge quantities of content that they're seeking to make more accessible by making it one-click playable in the browser. It's worked out brilliantly for disk images from the 8-bit computer era, and I expect this new project will work out even more so.
"And completing this thought, by choosing something like VLC, with its top-down open source condition and universal approach, the “closing of the loop” from VLC being available in all browsers instantly will ideally cause people to find the time to improve and add formats that otherwise wouldn’t experience such advocacy. Images into Apple II floppy disk image? Oscilloscope captures? Morse code evaluation? Slow Scan Television? If those items have a future, it’s probably in VLC and it’s much more likely if the web uses a VLC that just appears in the browser, no fuss or muss."
This makes a lot of sense for the internet archive. There are many "lets do it in js because we can" projects, this is not one of those.
He hopes having that capability in the browser will inspire people to add even more obscure formats to VLC. So it's a virtous cycle.
In theory it would also enable browsers to support 'wierd' new formats like BPG [1], FLIF [2] and Lepton [3] which are never going to get widespread support or any support at all.
[1] https://en.wikipedia.org/wiki/Better_Portable_Graphics
[2] https://en.wikipedia.org/wiki/Free_Lossless_Image_Format
[3] https://blogs.dropbox.com/tech/2016/07/lepton-image-compress...
But this would mean support for an incredible number of input formats.
At least that is how I understand their goals.
I'm mostly guessing.
I wonder how heavy different encodings/formats will be to decode in JS. Haven't worked with video on that level of detail, but I imagine that there a plenty of optimizations that can be done in low-level languages to get solid performance that JS might not deliver.
VLC also might be "more robust" (in terms of accomodating for file corruption) than your browsers' player, might provide a more "stable" experience cross browsers, or allow things like "convert that video file for me in the browser to images and show me those instead" etc. FWIW.
vespakoen noted that there is already ffmpeg library compiled with emscripten:
http://bgrins.github.io/videoconverter.js/demo
My speed test of webm to mp4 conversion (it doesn't display the video, it's just ffmpeg) showed the JS version around 10 times slower than the native ffmpeg.
The test was on relatively recent i7 and the latest Firefox (certainly having as fast asm.js as possible) then (around a month ago). I haven't investigated the cause for such significant speed difference.
Edit: add attribution
But archive.org wants to preserve and publish many formats that are not high resolution, high frame-rate video, and we can expect both performance and power consumption to improve over time.
The trend for the last couple of years or so has been for browsers to deprecate third-party browser plugins.
For example, Mozilla is deprecating NPAPI just as fast as it can, because it long predates e10s (Chrome-style process isolation) and they do not play well together. e10s has been so long delayed already, and Firefox's performance problems are so intractable to solve without it, that from the perspective of a very long-time Firefox user like me this is very obviously the correct course of action.
This deprecation will break the existing VLC plugin for Firefox, but that's not a huge deal because it never has worked very well in any case - developing a reliable NPAPI plugin is a seriously hard problem in general and has been since browsers got complicated enough to do interesting things in the first place. You also have to restart the browser to make any changes to the set of installed NPAPI plugins, and that's a lot more of a problem than it was before the browser became an application runtime. Now that the JS runtime is fast and capable enough to run "real application" code, we derive a much better experience by leveraging that power than we do by targeting a legacy interface that is relatively ill documented and much easier to get wrong in ways that break the whole browser rather than just one page or tab. We also get cross-browser compatibility of a sort that NPAPI never could offer.
I get that a lot of people think it's weird for the web browser's page scripting language, which was nothing more than a cute toy a couple decades ago, to be eating the world like this. I think it's weird, and it's how I earn a living! But, weird or not, it's also the best application platform we have or likely soon will have for a broad and widening variety of use cases, and that is because, while no more perfect than anything else, it actually works really well. Railing bitterly against technology that works really well seems potentially counterproductive to me. But I appreciate there exists a diversity of opinion on the subject.
You can reasonably expect it to run... until the first non-backward compatible change in anything the code depends on. The major assumption for this to keep working is that everything has to be permanently kept up-to-date for all the breaking dependencies. And I assume it will always be easier to produce a Linux or Windows binary that works relatively long without changes than anything that non-trivially depends on the web technologies.
A few years ago, as far as I know, it was still possible to run the Netscape Navigator binary which was around 20 years old on the recent Linux kernel.
[1] http://www.cvedetails.com/product/9978/Videolan-Vlc-Media-Pl...
It already exists, see my other comment for more details.
I wrote about some stuff here https://paul.kinlan.me/ffmpeg-ideas/ when building https://paulkinlan.github.io/deviceframe.es/ (I do a lot of screencasts and need a simple way to scale this out to other people that doesn't involve installing ffmpeg and scripting)
EDIT and Note: Also I just saw your comment about videoconvert.js
Have you compared the speed of Android javascript ffmpeg vs PC native? What happens with the battery?
I think mobile is a secondary consideration in this at this point. Considering it is connected to the internet archival efforts and simply ensuring the survival of numerous video/audio formats I imagine they are fine if it isn't efficient but simply effective at this point.
Edit: on second thought, you might not be commenting on the VLC.js thing, I haven't read about the ffmpeg js stuff ;)
I've asked about
If they manage to make this run and use emscripten and manage to build all the video computation optimizations.. how far of a stretch is it really to combine lodash+emscripten+BLAS/LAPACK to build a high performance computing platform based on javascript ?
Why not aspire to replace javascript entirely with something better?
ES6/emscripten/Typescript was not designed in 2 weeks. could you talk about what you mean.
Besides -- and this is key -- they're not rewriting it in Javascript. Javascript (via Emscripten) is a compile target for the code they already have.
Those who have read the article know this; it's right there in the article:
I know that it sounds like porting things to Javascript
is crazy. I find that people think we’re rewriting things
from scratch, instead of using Emscripten, which compiles
out to Javascript as a target (and later WebAssembly). We
do not write from scratch.You almost make me wish Java applets or sigh ActiveX back.
Those languages already have the libraries, tools, community, etc.