Page 1 of 1

VLC plugin - Support for HTML5 video tag

Posted: 06 Apr 2010 20:26
by zseliz
Hi!

The VLC media player supports a huge number of video codecs including proprietary codecs like H.264. HTML5 now provides a standardized way to embed audio and video files to the web pages. Unfortunately, at this time W3C doesn't specify any compulsory codec for the browsers which they should at least support.

This led to the current situation that some of the major web browsers support the proprietary H.264 (for example Safari) codec while the others (like Opera, Mozilla Firefox, etc.) support the royalty-free Theora codec.

In my opinion, the VLC media player should help to improve this situation. Now, the standard Windows installer containes a plugin for Mozilla Firefox and for Internet Explorer. It may help to embed videos into web pages, but in the current form it is not compatible with the HTML5 specification.

Would you mind to add support for the HTML5 video tag in the future?

I am looking forward to your opinion about this.

Re: VLC plugin - Support for HTML5 video tag

Posted: 07 Apr 2010 01:07
by Jean-Baptiste Kempf
Patches are welcome.

Re: VLC plugin - Support for HTML5 video tag

Posted: 07 Apr 2010 16:07
by VLC_help
I think this would require new browser API since this isn't about mime types or default embed objects.

Re: VLC plugin - Support for HTML5 video tag

Posted: 07 Apr 2010 17:27
by zseliz
I think this would require new browser API since this isn't about mime types or default embed objects.
I am not really into the XUL language of Mozilla, I have just experimented with it a few months ago. According to the HTML5 specification, everything within the <video> tag is displayed only if the video itself cannot be displayed.

Maybe the plugin should modify the HTML DOM in a way like this:

1. Detect the HTML5 <video> element
2. Create an <embed> element within the <video> element with the correct attributes

In my opinion in this case a new API is not neccessary. The browser plays the video if it has native support for its codec and calls for the VLC player if not. The only problem may occure with the control elements.

But as I have mentioned it above I have never developed a complete plugin neither for Firefox, nor for IE. It would be really good to read the opinion of people who take part in the development of the plugin.

And another question: where can the source files for the browser plugins found? Are they bundled with the official tarball?

Re: VLC plugin - Support for HTML5 video tag

Posted: 08 Apr 2010 15:57
by VLC_help
That way you would only support Firefox versions. I was thinking more like generic browser plugin, that would work with Opera, Safari etc. Your plan can be achieved quite easily with Greasemonkey script (there might already be one).
where can the source files for the browser plugins found? Are they bundled with the official tarball?
There are located in projects subfolder.
http://git.videolan.org/?p=vlc.git;a=tr ... ts;hb=HEAD

Re: VLC plugin - Support for HTML5 video tag

Posted: 09 Apr 2010 22:12
by bububu
According to the HTML5 specification, everything within the <video> tag is displayed only if the video itself cannot be displayed.
Logically it should, but that's not what the spec says:
Content may be provided inside the video element. User agents should not show this content to the user; it is intended for older Web browsers which do not support video, so that legacy video plugins can be tried, or to show text to the users of these older browsers informing them of how to access the video contents.
So everything within the <video> element (except for <source>) is displayed only if the video element itself is not recognized by the browser. It's braindead, but that's how it is, thank Mr Hickson for that. :evil:

In Firefox, for a <video> that has only an H.264 source, a broken video player with an X sign is displayed instead of the fallback content. Opera just fails silently. If the controls attribute of the <video> tag is not set, neither the <video> nor the fallback content is rendered.

The HTML5 spec has example code for a Javascript fallback using the error event "if the author isn't sure if the user agents will all be able to render the media resources provided" (how should the author know?). The VLC plugin could do that. An alternative (short of hooking into each browser's video engine) would be to replace the <video> element before the renderer sees it.

It wouldn't make much sense to implement HTML5 video without the standardized Javascript API (controls, events/callbacks, download link) that comes with it. So it certainly won't be easy.

For Firefox, I found this addon that uses plugins to render <video>: System Video. Don't know if it works with VLC. They only mention Quicktime.

Re: VLC plugin - Support for HTML5 video tag

Posted: 17 Apr 2010 16:49
by napx
With rumors that Google will be open-sourcing the VP8 codec and patents they acquired, I think the HTML5 video impasse will start to be resolved in 1-3 months with future browser versions and changes to websites. I wouldn't allocate resources to the HTML5 issue right now. Things will be much clearer this summer.

Re: VLC plugin - Support for HTML5 video tag

Posted: 18 Apr 2010 17:56
by VLC_help
I wouldn't allocate resources to the HTML5 issue right now. Things will be much clearer this summer.
I hope so.

Re: VLC plugin - Support for HTML5 video tag

Posted: 20 May 2010 00:15
by napx
Here goes: http://www.webmproject.org/
Google just gave us the VP8 codec open-sourced and free-licensed. They chose to pair it with ogg vorbis for audio and put it in a restricted version of matroska container they are calling "webm".

The quality at the moment looks like somewhere between xvid and h.264, significantly better than Theora.

Barring any patent lawsuit meltdowns, we will see browsers supporting this new codec through html5 and software players picking up support very soon. Think next major version of your favorite softwares. There are already firefox and chromium builds supporting it, as well as ffmpeg patches. That's one more piece of work for VLC :)

Next, we will also begin to see this format supported in hardware and devices.

Overall pretty sweet if you ask me.

Re: VLC plugin - Support for HTML5 video tag

Posted: 20 May 2010 17:11
by VLC_help
Preliminary support for VP8 and webm has been added to nightlies.

Re: VLC plugin - Support for HTML5 video tag

Posted: 21 May 2010 02:56
by napx
awesome :)

Re: VLC plugin - Support for HTML5 video tag

Posted: 21 May 2010 15:42
by Lotesdelere
Preliminary support for VP8 and webm has been added to nightlies.
For testing purposes a pre-RC build with WebM support can be found on this page.

Re: VLC plugin - Support for HTML5 video tag

Posted: 22 May 2010 02:52
by pdfan
is it possible to test webm vlc on gentoo?

Re: VLC plugin - Support for HTML5 video tag

Posted: 22 May 2010 16:15
by VLC_help
If you build nightlies from sources, it should be possible.

Re: VLC plugin - Support for HTML5 video tag

Posted: 22 May 2010 18:46
by pdfan
using gentoo package vlc-1.0.9999 ( git://git.videolan.org/vlc/vlc-1.0.git), how to test webm?

Re: VLC plugin - Support for HTML5 video tag

Posted: 22 May 2010 18:51
by pdfan
# ffmpeg -v 8 -f video4linux2 -i /dev/video0 -vcodec libvpx_vp8 -vb 768k -f alsa -ac 2 -i hw:0,0 -acodec vorbis -ab 64k -f webm out.webm
# ffplay out.webm
work now,

# vlc out.webm
not work.

Re: VLC plugin - Support for HTML5 video tag

Posted: 23 May 2010 12:19
by Jean-Baptiste Kempf
Because your VLC isn't compile with VP8, obviously

Re: VLC plugin - Support for HTML5 video tag

Posted: 24 May 2010 10:59
by pdfan
how to enable webm in gentoo vlc-1.0.9999 ? if there's not ebuild, how to try webm from sources configure/make?

Re: VLC plugin - Support for HTML5 video tag

Posted: 24 May 2010 11:17
by pdfan
is it posible to live stream webm to HTML5 video tag using vlc? like the one claimed the first free software live streaming solution to have VP8 in WebM streaming live to browsers : http://zaheer.merali.org/articles/2010/ ... flumotion/

Re: VLC plugin - Support for HTML5 video tag

Posted: 24 May 2010 19:03
by VLC_help
is it posible to live stream webm to HTML5 video tag using vlc?
In theory yes.