News for hackers. Stuff that matters.
Re:A Simple Explanation: VLC.js by kowdermeister on Tuesday December 06, 2016 @05:55AM (#13113692)
> I firmly believe that this project, fundamentally, would change the relationship of audio/video to the web.

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.

Re:A Simple Explanation: VLC.js by MrBuddyCasino on Tuesday December 06, 2016 @06:02AM (#13113715)
I think its mostly interesting for supporting niche file formats directly, as he says:

"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.

Re:A Simple Explanation: VLC.js by throwanem on Tuesday December 06, 2016 @06:01AM (#13113712)
"I can't play back media in the browser that it doesn't natively support unless I transcode it first."

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.

Re:A Simple Explanation: VLC.js by ZeroGravitas on Tuesday December 06, 2016 @06:06AM (#13113734)
He explains near the bottom. Rather than convert weird old formats to something the browser understands, which is what they do currently, this lets them play them directly.

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.

Re:A Simple Explanation: VLC.js by arthurfm on Tuesday December 06, 2016 @09:13AM (#13114657)
> Rather than convert weird old formats

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...

Re:A Simple Explanation: VLC.js by molf on Tuesday December 06, 2016 @06:01AM (#13113710)
Support for the same wide variety of formats that VLC now supports.

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.

Re:A Simple Explanation: VLC.js by grenoire on Tuesday December 06, 2016 @06:02AM (#13113721)
VLC's support comes from its support for the codecs. Why not port the codecs to JavaScript so that the existing HTML5 features can make use of those formats?
Re:A Simple Explanation: VLC.js by ZeroGravitas on Tuesday December 06, 2016 @06:09AM (#13113742)
For this to work, the codecs need to be able to compile to JS via emscripten, so what you are asking for is necessarily part of the task.

But playing a DVD, for example, isn't just about codecs, they have menus and various other features that need to be implemented too.

Re:A Simple Explanation: VLC.js by lawik on Tuesday December 06, 2016 @08:32AM (#13114428)
I'm curious how VLC usually draws inline UI elements, menu effects and such. If they need to be implemented separately per platform or if they just need to create an adapter for drawing the usual VLC UI.
Re:A Simple Explanation: VLC.js by matthewbauer on Tuesday December 06, 2016 @01:07PM (#13116794)
I think they just use Qt.
Re:A Simple Explanation: VLC.js by lawik on Tuesday December 13, 2016 @01:44PM (#13169395)
Supported on tons of platforms, makes sense I guess. Linux has some variant for GTK as well if I recall correctly.
Re:A Simple Explanation: VLC.js by lawik on Tuesday December 06, 2016 @06:26AM (#13113804)
It seems to me that they would use these HTML5 features and APIs to implement audio and the actual pixel output from the VLC codecs.

But this would mean support for an incredible number of input formats.

At least that is how I understand their goals.

Re:A Simple Explanation: VLC.js by matthewbauer on Tuesday December 06, 2016 @01:09PM (#13116824)
This seems right: just perform the conversion in the browser and play the output in a <video> tag. The alternative would be to draw frame-by-frame in a canvas which would be very difficult.
Re:A Simple Explanation: VLC.js by lawik on Tuesday December 13, 2016 @01:49PM (#13169461)
Ah, you mean transcode to something the browser actually handles? I think that transcoding might be many variants of terribly slow though. I'm not sure drawing it to canvas frame by frame would be all that hard, VLC already does some kind of frame-by-frame drawing I'm guessing, on the output end. Canvas should be plenty fast enough as long as the decoder can keep up I imagine. I'm thinking this might be a good use of Web Workers to offload decoding to another core to avoid hanging the main thread (UI).

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.

Re:A Simple Explanation: VLC.js by rogerdpack on Tuesday December 06, 2016 @12:04PM (#13116176)
My goal/wish would be that it could playback local DVD's somehow... :)

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.

Re:A Simple Explanation: VLC.js by grenoire on Tuesday December 06, 2016 @06:00AM (#13113706)
You can even get subtitles on top of HTML5 videos with simple positioned elements with text shadows for borders. I can't say I understand the motive of the project either, other than "see, everything can be done in JavaScript!"
Re:A Simple Explanation: VLC.js by vdnkh on Tuesday December 06, 2016 @11:14AM (#13115692)
Much harder than it sounds if you care about live streaming, video playlists, and cross-browser support. Don't forget to mention the 3 big subtitles formats (608/708/VTT) and some smaller ones (SRT/DFXP).

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!

Re:A Simple Explanation: VLC.js by danielsamuels on Tuesday December 06, 2016 @06:40AM (#13113862)
Or just use a `<track kind="subtitles">` and reference a vtt file?
Re:A Simple Explanation: VLC.js by kuschku on Tuesday December 06, 2016 @08:14AM (#13114315)
Which doesn't allow SRT subtitles, or XML subtitles (hello German public broadcasters!), or ASS subtitles (hello anime fandub groups!)

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.

Re:A Simple Explanation: VLC.js by fridek on Tuesday December 06, 2016 @06:44AM (#13113890)
Which is a format you need to convert to rather than use existing srt or anything else really.
Re:A Simple Explanation: VLC.js by hamilyon2 on Tuesday December 06, 2016 @10:24AM (#13115209)
Correct subtitles are big deal for i18n and accessibility viewpoints.
Re:A Simple Explanation: VLC.js by _joel on Tuesday December 06, 2016 @09:59AM (#13115001)
The Dash.js MPEG-DASH reference player can handle EBU-TT-D subtitles.