Log in

View Full Version : AviSynth as HTML5 video source


Metaphore
5th June 2013, 14:47
Is there a way to use AviSynth on a <source> of a <video> tag in HTML5?

paradoxical
5th June 2013, 15:19
No, there isn't outside of modifying the browser itself to add support for an Avisynth script in the video tag.

jordanh
6th June 2013, 00:03
Is there a way to use AviSynth on a <source> of a <video> tag in HTML5?

The question itself doesnt make sense without explaination. It is hard to guess whats your goal.
Where do you want to let avisynth be executed? on the server or on the clients?

Do you really target the clients to do the filtering work on their own? - did you think about the nature environment? - how much power would that cost more than doing the video transformation only once.

Seedmanc
6th June 2013, 13:10
There must be some programs that can make .avs looks like .avi to programs that can't accept .avs. I think one of them was a plugin to Pismo File Mounter that "mounts" .avs as a folder with .avi and .wav + script itself.

paradoxical
6th June 2013, 15:08
There must be some programs that can make .avs looks like .avi to programs that can't accept .avs. I think one of them was a plugin to Pismo File Mounter that "mounts" .avs as a folder with .avi and .wav + script itself.

Which is irrelevant when most browsers only support specific video formats.

Metaphore
6th June 2013, 17:07
The goal is to add special effects to an HTML5 interactive video sign displayed on a bank of monitors. This is not an Internet Web Site, it's an HTML5 application. For the sake of discussion, assume it's birds and butterflies flying in the foreground as the interactive sign displays information and running counters. The data being displayed is real time, so the birds and butterfiles need to fly through a transparent background. I can do this with sprites. I can do this with animated, full-screen GIFs. Can I do this with an AVI with an alpha channel? That's what I am trying to find out here. I need AviSynth to process the alpha channel, is my thought.

And it's all running in Google Chrome. Or something else if I choose. There is only one client.

paradoxical
6th June 2013, 17:12
It cannot be done in a video tag. Chrome only supports H.264, Ogg Theora and WebM in a video tag. No browser is going to support playing uncompressed video from an avisynth script unless you modify the browser's behavior yourself as I told you above. Or you would need to create a custom plugin to do what you want.

Metaphore
6th June 2013, 17:36
Thank you all for the help. I hope I didn't upset some people as much as it seems I did. I would hate having my butterfiles be the cause of someone's hypertension related ailment.

paradoxical
6th June 2013, 17:42
Thank you all for the help. I hope I didn't upset some people as much as it seems I did. I would hate having my butterfiles be the cause of someone's hypertension related ailment.

Who is upset? We are simply telling you that what you want is not possible using the HTML5 video tag. The issue is that the video tag is not meant to be a media player that supports arbitrary formats. It's meant to be a way for browsers to natively play a limited subset of formats. To do what you want the easiest way is to use a plugin via the object tag with one example being what jordanh shows you.

jordanh
6th June 2013, 17:51
The others are right, the html5 player comes from the browser, not from the operating system. The concept of html5 video tag is just different than you assume.


Seedmac:
There must be some programs that can make .avs looks like .avi to programs that can't accept .avs. I think one of them was a plugin to Pismo File Mounter that "mounts" .avs as a folder with .avi and .wav + script itself.


There are. E.g. Avisynth virtual file system. Still you would need a player with browser plugin that supports those kind of avi.


Metaphore:

There is only one client.


Basically paradoxical is right, there is no way doing it DIRECTLY with HTML5 video tag unless you're able to modify the browser code itself (the player of the browser). On the other hand, you can use html5 when you just set up some streaming server thats able to handle avs (needs to have a "directshow" importer or special avs support). Even when its on the same machine. In the end you need to provide a h264 stream for using html5. Examples for that should be vlc (VOD feature) and ffmpeg server or even normal ffmpeg.


Another solution, much easier:
You can just use windows media player instead, but of course the client must have avisynth installed. Thats will be least effort for you. You can also try wmp plugins for other browsers than internet explorer.

Here is your code...


//file: avisynth_in_browser.html
//local avisynth player in browser

<object id="mediaplayer" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701"
standby="loading microsoft windows media player components..." type="application/x-oleobject" width="320" height="310">
<param name="filename" value="C:\Program Files (x86)\AviSynth 2.5\Examples\Authors.avs">
<param name="animationatstart" value="true">
<param name="transparentatstart" value="true">
<param name="autostart" value="true">
<param name="showcontrols" value="true">
<param name="ShowStatusBar" value="true">
<param name="windowlessvideo" value="true">
<embed src="./test.wmv" autostart="true" showcontrols="true" showstatusbar="1" bgcolor="white" width="320" height="310">
</object>